Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature. Add path to requirements.txt #9

Closed
Niccolum opened this issue Aug 13, 2021 · 4 comments
Closed

Feature. Add path to requirements.txt #9

Niccolum opened this issue Aug 13, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Niccolum
Copy link

In my project I use next requirements hierarchy:
requirements/base.txt
requirements/dev.txt
requirements/docs.txt
requirements/test.txt
requirements/lint.txt

I want to check one or multiple files in this hierarchy, but according 2021.2 release - I can't.
Same hierarchy we can see, for example, here:
https://github.com/aio-libs/aiohttp/tree/master/requirements
can you add optional flag path to file?

@Niccolum Niccolum changed the title Feature Feature. Add path to requirements.txt Aug 13, 2021
@FredHappyface
Copy link
Member

Yeah can do, I'll add that to my to-do list

@FredHappyface FredHappyface added this to the 2021.4 milestone Aug 14, 2021
@FredHappyface FredHappyface self-assigned this Aug 14, 2021
@FredHappyface FredHappyface added the enhancement New feature or request label Aug 14, 2021
@FredHappyface
Copy link
Member

Do you only foresee needing to check one requirements.txt at a time or will you be wanting to pass in a list of these?

At the moment I am thinking of implementing the api like this:

licensecheck --using requirements:path/to/reqs.txt

My proposal for multiple requirements would be:

licensecheck --using requirements:path/to/reqs.txt;path/to/other/reqs.txt

The drawback would be that : and ; become reserved chars. Solving this for Windows should be quite easy though and just splitting on the first ::

licensecheck --using requirements:c:/path/to/reqs.txt;path/to/other/reqs.txt

@Niccolum
Copy link
Author

Niccolum commented Aug 14, 2021

What do you think about next:
At first, I don't know any person, who use requirements.txt and poetry in one project, so, we can still use --using flag, as you already created.
licensecheck --using requirements
but for path to file, I think, be better to use another flag, for example --path. And, as I know, we can use nargs=+ or append option for cli parser. Here is examples
https://stackoverflow.com/a/15753721
My main point is not to mix the purpose of two different flags - the type of requirements and the path to them.
And, if it easy to implement - it well be great to add to --path - path to dir, where it search requirements by pattern *.txt for requirements and *.lock for poetry instead of path to concrete file or files.

@FredHappyface
Copy link
Member

fixed in 2021.4

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

No branches or pull requests

2 participants