Fix InvalidMatchSpec error when installing packages using setup.py
No published issue related to this.
In setup.py, within the conda_install function, dep = f'"{dependency}"' leads to an conda error when installing a package with requied version, such as gemmi>=0.6.4: InvalidMatchSpec: Invalid spec '"gemmi>=0.6.4"': Invalid version '0.6.4"': invalid character(s) (*conda version: 25.1.1)
To Reproduce: Create a new env and run python setup.py install_requires, or simply: 'conda' 'install' '"gemmi>=0.6.4"' (How setup.py install package).
The setup.py print:Installing packages using: /xxx/bin/conda install "gemmi>=0.6.4", but it actually using:'/xxx/bin/conda' 'install' '"gemmi>=0.6.4"'
- I confirm that I have merged the latest version of
develinto this branch before issuing this pull request (e.g. by runninggit pull origin devel): [y] - I confirm that I have added a changelog entry to the changelog (we will add a link to this PR as part of the review): [y]
- I confirm that I have permission to release this code under the GPL3 license: [y]
Suggested reviewers:
@chryswoods, @lohedges
Any additional context of information?
Also updated the installation command in the documentation.
Many thanks. I've resolved this locally but hadn't pushed a fix (mostly because it doesn't affect the Python versions used for the CI).
@chryswoods: I think the fix on your feature branch in slightly different, albeit with the same affect. Are you okay with this, or should I patch in your change instead. (Mostly to avoid conflicts later.)
I don't have a strong preference. I stripped the quotes when the conda command was created in case I mistakenly put quotes into the requirements files ;-)