-
Notifications
You must be signed in to change notification settings - Fork 10
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
Conda recipe #404
Conda recipe #404
Conversation
- pytest-cov==2.10.0 | ||
- requests==2.31.0 | ||
- requests-mock==1.8.0 | ||
- retry==0.9.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why these requirements have to be present in both host
and run
sections, but it's the only way I could get it to work...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
bin/cmat/cmat
Outdated
# ones in Andries Feder's Cladebreaker (https://github.com/andriesfeder/cladebreaker) | ||
# and Robert A. Petit III's Bactopia (https://bactopia.github.io). | ||
|
||
VERSION=3.0.6.dev3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth moving the version to a text file and read that from both the setup.py
and this wrapper script?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's a chicken and egg problem, because this wrapper script uses the version to figure out where the shared files are, which presumably would include the separate text file...
Perhaps the conda build script could modify this wrapper to include the correct version number, but I'd have to think it through.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there not a better way to store the version, especially when there's also the {% set version = "3.0.6.dev3" %}
at the meta.yaml
file?
We end up having the same information in different places, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, right now the version is in 3 places, which is not great...
I think the version has to be in at least 2 places though, i.e. somewhere in this repo and in bioconda-recipes (which is what everything in the conda
directory is reflecting).
I will try to get the setup.py
and the wrapper script to use a single source though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to get this working with 2 sources of version without too much difficulty. I also created #406 for automating the conda release which I believe should let us have just 1 source of version, as the automated release would generate the meta.yaml
file using the same VERSION file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently trying to test it locally. The installation is taking a long while, so I'll be back after it finishes. For now, a few comments in-line, plus:
- Documentation. Should we include a remark on how to install it through Conda in the README? Especially if we are expecting all to use a virtual environment.
bin/cmat/cmat
Outdated
# ones in Andries Feder's Cladebreaker (https://github.com/andriesfeder/cladebreaker) | ||
# and Robert A. Petit III's Bactopia (https://bactopia.github.io). | ||
|
||
VERSION=3.0.6.dev3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there not a better way to store the version, especially when there's also the {% set version = "3.0.6.dev3" %}
at the meta.yaml
file?
We end up having the same information in different places, no?
Update on the local testingFailed tests but successful build (?)
Failed installationEven when it said that the installation was successful in the previous prompt, I guess since the tests were not passed, it moved everything to the broken directory of conda, and it wasn't found when to be installed:
|
For your installation error @M-casado, are you using WSL by chance? @tcezard Btw, did you get it working on Mac?
Yes definitely, I'll add it once it's been actually added to the bioconda channel, since that requires another PR and I'm not sure how long that will take... |
@@ -1,4 +1,4 @@ | |||
{% set version = "3.0.6.dev3" %} | |||
{% set version = "3.0.6.dev4" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case it's a hassle for you to change this manually. Now that we have the version within the file VERSION
, would it be handy to have a very simple python script that replaces this bit of version in the meta.yaml
, triggered by a GitHub action?
For example, something like the following, summarised by our friend GPT:
import re
version_file_path = 'VERSION'
yaml_file_path = 'meta.yaml'
with open(version_file_path, 'r') as file:
version = file.read().strip()
with open(yaml_file_path, 'r') as file:
yaml_content = file.read()
new_yaml_content = re.sub(r'{% set version = ".*" %}', f'{{% set version = "{version}" %}}', yaml_content)
with open(yaml_file_path, 'w') as file:
file.write(new_yaml_content)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, only if it's less of a hassle to keep in mind that the VERSION is also in the YAML file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or actually, rather than modify this YAML file, why not have the other files read the file meta.yaml
instead of VERSION
? That way, the version exists only in one place. We could use a regex to find the version within this yaml file and extract it instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay for now, but it's something to keep in mind for a future PR (e.g. in #406)... we can decide the direction of information flow (i.e. from VERSION to YAML or vice versa) and how it's triggered there.
You are very right. I encounter that problem from time to time. but normally the errors are more informative. It is probably what you mentioned. I'll wait then till you publish it to test the installation through conda. |
@@ -1,4 +1,4 @@ | |||
{% set version = "3.0.6.dev3" %} | |||
{% set version = "3.0.6.dev4" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, only if it's less of a hassle to keep in mind that the VERSION is also in the YAML file
@@ -1,4 +1,4 @@ | |||
{% set version = "3.0.6.dev3" %} | |||
{% set version = "3.0.6.dev4" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or actually, rather than modify this YAML file, why not have the other files read the file meta.yaml
instead of VERSION
? That way, the version exists only in one place. We could use a regex to find the version within this yaml file and extract it instead
The
conda
directory will be submitted (with updated checksum etc.) tobioconda-recipes
, at which point CMAT would be available as usual from the bioconda channel.If you want to test locally before it's released on bioconda, you should be able to do the following:
source
andbuild
sections inconda/meta.yaml
with: