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

Handle --requirement argument, not just -r #18

Open
Zac-HD opened this issue Sep 24, 2019 · 2 comments
Open

Handle --requirement argument, not just -r #18

Zac-HD opened this issue Sep 24, 2019 · 2 comments

Comments

@Zac-HD
Copy link

Zac-HD commented Sep 24, 2019

req_option = '-r'
if dep_name.startswith(req_option):
return dep_name[len(req_option):]

is great, but doesn't handle the long-form option:

[testenv:test]
deps =
    --no-deps
    --requirement deps/test.txt

This would be a good issue for someone to handle for Hacktoberfest 😄

@signalpillar
Copy link
Owner

signalpillar commented Sep 30, 2019

@Zac-HD indeed it doesn't. Thank you for reporting.

I haven't seen usage of --no-deps before.
Does tox config skipsdist work for you?

@Zac-HD
Copy link
Author

Zac-HD commented Oct 1, 2019

No problem 😄

--no-deps means "install exactly the packages listed, and nothing else - not even their dependencies". It's obviously only useful with lockfiles, but important in case e.g. your lockfile was missing something which would then not be properly locked. So tox's skipsdist is really a separate thing - --no-deps isn't related to this issue, it's just something I have in my config.

While I think about it, it would be good to handle all of the following cases - currently only file1.txt-style is supported:

[testenv]
deps =
    -rfile1.txt
    -r file2.txt
    -r=file3.txt
    --requirement file4.txt
    --requirement=file5.txt

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

No branches or pull requests

2 participants