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

-m entry point #167

Closed
tonybaloney opened this issue Dec 2, 2021 · 4 comments · Fixed by #173
Closed

-m entry point #167

tonybaloney opened this issue Dec 2, 2021 · 4 comments · Fixed by #173
Assignees
Labels
component:cli CLI components component:docs Documentation components enhancement New feature or request

Comments

@tonybaloney
Copy link

I'm trying to configure pip-audit to run automatically for my project.

I have to run pip audit via python -m pip_audit, but there is no module entry point.

Please could one be added? IT looks like it would just run _cli:audit,

Happy to raise a PR if you agree this is useful.

@tonybaloney tonybaloney added the enhancement New feature or request label Dec 2, 2021
@woodruffw
Copy link
Member

Yeah, I think we can do that.

Just out of curiosity: is there a reason why you can't run the pip-audit console entrypoint directly?

@woodruffw woodruffw added the component:cli CLI components label Dec 2, 2021
@di
Copy link
Member

di commented Dec 2, 2021

We should definitely do this, and also encourage using $ python -m pip-audit instead of $ pip-audit in our docs and examples.

@di di added the component:docs Documentation components label Dec 2, 2021
@tonybaloney
Copy link
Author

Yeah, I think we can do that.

Just out of curiosity: is there a reason why you can't run the pip-audit console entrypoint directly?

I'm configuring this as a task in VS Code that runs whenever a project is opened, so you have to get the python interpreter from a variable and the venv isn't activated.

.vscode/tasks.json will look like this--

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Pip Audit",
            "type": "shell",
            "command": "${command:python.interpreterPath}",
            "args": ["-m", "pip-audit"],
            "isBackground": true,
            "group": "none",
            "runOptions": {
                "runOn": "folderOpen",
            },
        },
    ]
}

@woodruffw
Copy link
Member

@tonybaloney Done with #173!

This should work for you now, assuming you install from GitHub:

python -m pip_audit [args...]

And we'll cut a release with that soon, as well.

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

Successfully merging a pull request may close this issue.

3 participants