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

Correctly define extras in setup.cfg #755

Merged
merged 4 commits into from Jan 25, 2022
Merged

Correctly define extras in setup.cfg #755

merged 4 commits into from Jan 25, 2022

Conversation

mkniewallner
Copy link
Contributor

When trying to install version 1.7.1 of bandit with toml extra, setup.py is not able to find the extra:

$ pip install bandit[toml]==1.7.1

Collecting bandit[toml]==1.7.1
WARNING: bandit 1.7.1 does not provide the extra 'toml'

Since the project uses pbr, it seems like, according to the documentation, extras should be used in place of options.extras_require, which should only be used when setup is invoked without pbr plugin.

Similarly, entry_points should be used in place of options.entry_points, according to the documentation (this was updated here).

To check that it now works:

$ pip install git+https://github.com/mkniewallner/bandit.git@fix-extras-setup-cfg#egg=bandit[toml]

Collecting bandit[toml]
  Cloning https://github.com/mkniewallner/bandit.git (to revision fix-extras-setup-cfg) to /tmp/pip-install-xedwbqa3/bandit_2a283e93351349f78ff170aba85357f7
  Running command git clone --filter=blob:none -q https://github.com/mkniewallner/bandit.git /tmp/pip-install-xedwbqa3/bandit_2a283e93351349f78ff170aba85357f7
  Running command git checkout -b fix-extras-setup-cfg --track origin/fix-extras-setup-cfg
  Switched to a new branch 'fix-extras-setup-cfg'
  Branch 'fix-extras-setup-cfg' set up to track remote branch 'fix-extras-setup-cfg' from 'origin'.
  Resolved https://github.com/mkniewallner/bandit.git to commit 5ce994090f9023506a624045eb568886ca47b4cd
  Preparing metadata (setup.py) ... done
Collecting toml
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)

Side question: I'm not that familiar with pbr, but are there advantages using it rather than only using setuptools?

Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

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

LGTM

@ericwb
Copy link
Member

ericwb commented Jan 25, 2022

Side question: I'm not that familiar with pbr, but are there advantages using it rather than only using setuptools?

Yes, 'pbr' main advantage is versioning according to the tags we create.

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.

None yet

2 participants