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

Support pip-audit configuration from pyproject.toml #694

Open
dnovvak opened this issue Nov 8, 2023 · 6 comments
Open

Support pip-audit configuration from pyproject.toml #694

dnovvak opened this issue Nov 8, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@dnovvak
Copy link

dnovvak commented Nov 8, 2023

Is your feature request related to a problem? Please describe.

Yes, having a single CI workflow for multiple repositories we cannot easily ignore vulnerabilities affecting single repository only. Also specifying extra indexes per repository is severely hampered here.

Describe the solution you'd like

With pip-audit configuration in pyproject.toml we could specify custom settings just on single repository level having the CI untouched (CI is executing always poetry run pip-audit).

For example:

# pyproject.toml

[tool.pip-audit]
ignore-vuln = [
    "CVE-TO-IGNORE",
]
extra-index-url = [
    "https://my-pypi.com/simple",
]

Describe alternatives you've considered

Using another tool.

Additional context

The most used code quality tools for python support configuration from pyproject.toml. For example:

So I wonder that the official tool from PyPA does not follow community standards.

@dnovvak dnovvak added the enhancement New feature or request label Nov 8, 2023
@di
Copy link
Member

di commented Nov 8, 2023

So I wonder that the official tool from PyPA does not follow community standards.

This is mostly a volunteer-run project, it just hasn't been implemented yet. I think we're all likely in favor of this.

@woodruffw
Copy link
Member

To add on to what @di said: it's not that we don't follow community standards, but that pip-audit simply does not have any configuration file at the moment.

There are a number of complexities involved in adding one, such as determining how best to interoperate with pip's own configuration; see #193 for some details on that.

@dnovvak
Copy link
Author

dnovvak commented Nov 8, 2023

Thank you for adding some context to that @di @woodruffw!

I just saw that a few issues mention pyproject.toml as a possible resolution but it wasn't clear whether it's on your roadmap and couldn't find any ticket discussing this feature as a whole.

By the way, are you able to say something about the priority of this feature?

@woodruffw
Copy link
Member

By the way, are you able to say something about the priority of this feature?

It's not an immediate priority I believe, but I think we'd be happy to review a PR that makes these changes.

But before that, there should be some discussion on this issue about what the scope of the configuration will be:

  1. Will there be settings the mirror each of pip-audit's flags, or only some?
  2. Will there be settings that conflict with/take precedence over things in pip.conf?
  3. How should we handle discovery, i.e. should we only load from $CWD or keep walking up directories until we hit a pyproject.toml?
  4. How should we allow configuration for projects that don't use pyproject.toml, if we want to support this?

@albertodiazdorado
Copy link

I'd love if this was part of pip-audit :)

@woodruffw
Copy link
Member

I believe #694 (comment) covers the preconditions for this feature. We're interested in hearing from users about each of the bullets in that comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants