-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package Brian2CUDA #288
Package Brian2CUDA #288
Conversation
I had another look #212 and brian-team/brian2genn#101. I still think that the problems that came up there might not be relevant for Brian2CUDA (at least in my hands, I mostly had similar issues with Brian2GeNN, while Brian2CUDA mostly just worked), I would like to try to get a good conda package working. It might even be worth trying out |
We call the package
Again, no particular reason, we always used tags. The advantage is that you simply add a tag locally and push it to trigger a release instead of using github's GUI for it. I guess one could now use GitHub's CLI as easily, but well, it's not a high priority to change it, I think. The only advantage I'm seeing is that releases are more visible on GitHub and can have release notes.
Looks good to me (did not test anything, though).
The conda recipe is out of date and we don't use it anymore (we should probably delete it...). The relevant one for conda-forge is the one here: https://github.com/conda-forge/brian2-feedstock/blob/main/recipe/meta.yaml But it's not guaranteed to correctly works like this on a local machine, it relies on the conda-forge infrastructure. I'll have a look at the PyPI action.
Not quite, you'll have to follow a few steps: https://github.com/python-versioneer/python-versioneer#quick-install Regarding the version I don't have a strong preference, but I find
The issues I had were mostly with |
I added a minimal GitHub Action to build the packages and push them to (Test)PyPI. It seems to work in general, but the pushing step needs you (as the owner of the package on PyPI) to generate API tokens for TestPyPI and PyPI and then add them as "secrets" named |
@mstimberg Thanks, I added you as an owner to TestPyPi (there is no package on PyPi yet, I'll add you as soon as we have a first release that we upload). I'll add the secrets next week when I work on this again.
Ah, i didn't know it doesn't matter for the package name. In that case, I would call it Brian2CUDA I suppose.
I see. I do like the GitHub release visibility tbh. Maybe I'll add an Action to make an official release when pushing a tag. Well, but time... will see ^^
Ah, ok. Thanks. Does it make sense to have that for Brian2CUDA as well? I suppose it is triggered from the PyPi release?
Okay, will install it next week then. And I'm fine with
Okay. For now I think we should just have a basic conda package that depends on Brian2 only (to make it easy to install the correct version of Brian2 + Brian2CUDA in a conda environment; otherwise one installs maybe Brian2 via conda, then Brian2CUDA via pip, which installs a different Brian2 version via pip as dependency and there the mess starts). And forget about the |
Hi @denisalevi. Switching to versions starting with |
I think the only remaining packaging-related things that need to be done before the release are adding the TestPyPI/PyPI credentials as secrets on GitHub, and adding me as an additional maintainer. Conda package recipe will be trivial once the package is on PyPI (can be created via https://github.com/conda-incubator/grayskull). Maybe best to wait with the |
Great! Thanks for the help. I'll try to get the last fixes + docs done over the weekend, or if necessary next week. |
Okay. Credentials are added. Last non-optional TODOs have to be done once this PR is merged (and we uploaded first releases to PyPi). |
Looks all good to me 👍 |
Sure, the version name might just be weird (last tag being |
It will not consider the |
|
I started preparing a release. This PR should take care of packaging and versioning and should be merged only once everything else is ready.
EDIT: TODO list:
v
and change the versioneer section insetup.cfg
accordingly. This allows to have other tags than release tags, while the version is still the version withoutv
.MANIFEST.in
? It was added duringversioneer
install. What is this exactly for?master
tomain
(needs changes in github actions as well)conda-forge
package without any CUDA related package (onlybrian2
dependency), same as Brian2 receipe in the conda-forge feedstock, triggered by PyPi release (?)pyproject.toml
(andsetup.cfg
?) instead ofsetup.py
I updated
setup.py
and uploaded a PyPi package to Test PyPi: https://test.pypi.org/project/brian2cuda/.I tested it locally and on one of our clusters, worked without issues. Even when installing brian2 via conda first. As far as I can tell, Brian2CUDA has no issues with conda environments (we use
CXX
for host compilation, which uses the C++ compiler in the conda environment). And I had another look atnvcc_linux64
: All it does really is to provide a wrapper around a specificnvcc
version and make sure thatnvcc
usesCXX
for host compilation (which we do anyways). It also addscuda/include
include paths toC/CPP/CXXFLAGS
, but as far as I can tell, we don't need them (it works without in my test cases). I would addnvcc_linux64
as optional package to the installation instructions in case people want to choose a specificnvcc
version in their conda environment. But I wouldn't install it by default. Brian2CUDA already detects the defaultnvcc
and one can control thenvcc
path via Brian2CUDA environment variables or preferences as well.Hence, I see no problem in providing a conda package, all it needs is the correct Brian2 dependency and that's it.
@mstimberg Do you have time to support me with versioning and packaging? Few questions I had by looking into Brian's config files:
Brian2
instead ofbrian2
. Any specific reason for that, does it make sense to do the same for Brian2CUDA?setup.py
if it looks alright to you?0.1
and upgrade to1.0
once we think beta is over? Or go with1.0b1
(maybe depends also on versioneer?).