Skip to content
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

extras_require in setup.py #5408

Merged
merged 3 commits into from
May 27, 2020
Merged

extras_require in setup.py #5408

merged 3 commits into from
May 27, 2020

Conversation

smotornyuk
Copy link
Member

@smotornyuk smotornyuk commented May 25, 2020

Allow installation of requirements without any additional actions using pip(fetch requirements.txt, etc).
For example:

pip install ckan[requirements]
pip install ckan[setuptools,requirements-py2]
pip install ckan[requirements,dev]

For testing, try to use my fork:

pip install -e "git+https://github.com/DataShades/ckan.git@extras-require#egg=ckan[requirements,dev]"

@wardi
Copy link
Contributor

wardi commented May 25, 2020

does this break later upgrading any dependencies the way install_requires does?

@smotornyuk
Copy link
Member Author

Just checked it - no, if some other package will override dependencies specified in CKAN's extras_require, no errors will be produced. So it behaves more like requirements file

setup.py Outdated
('setuptools', 'requirement-setuptools.txt'), ('dev', 'dev-requirements.txt'),
]
for group, filepath in _extras_groups:
with open(filepath, 'r') as f:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this assumes you're running setup.py from the same working directory. better to use the path of the current module to be safe

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. I'm usually using pip install -e ... which implicitly changes directory to the package root before installation, so I didn't notice the problem, even though I've installed it from outside of CKAN's repo.

@wardi wardi merged commit 96c552d into ckan:master May 27, 2020
amercader added a commit that referenced this pull request Nov 10, 2020
Fixes #5726

This was missing from #5408, which allows installing the requirements
using pip, but didn't include the actual requirement files in the
published package, causing an exception when running `pip install ckan`
amercader added a commit that referenced this pull request Jan 15, 2021
Fixes #5726

This was missing from #5408, which allows installing the requirements
using pip, but didn't include the actual requirement files in the
published package, causing an exception when running `pip install ckan`
amercader added a commit that referenced this pull request May 14, 2021
Fixes #5726

This was missing from #5408, which allows installing the requirements
using pip, but didn't include the actual requirement files in the
published package, causing an exception when running `pip install ckan`
amercader added a commit that referenced this pull request May 14, 2021
fostermh pushed a commit to cioos-siooc/ckan that referenced this pull request Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants