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 arbitrary requirements files #33

Closed
Dreamsorcerer opened this issue Mar 25, 2021 · 2 comments
Closed

Support arbitrary requirements files #33

Dreamsorcerer opened this issue Mar 25, 2021 · 2 comments

Comments

@Dreamsorcerer
Copy link
Contributor

It would be good to have a config argument that allows specifying where the requirements files are (a simple glob pattern would work for most cases).

As an example, for the aiohttp project: https://github.com/aio-libs/aiohttp/tree/master/requirements
This would work if a simple pattern could be added to the config like requirements/* or requirements/*.txt.

Also worth noting that it doesn't pick these up from setup.py if read dynamically, like:

def read_requirements(path: str) -> List[str]:
    file_path = pathlib.Path(__file__).parent / path
    with open(file_path) as f:
        return f.read().split("\n")

setup(
    ...
    install_requires=read_requirements("requirements/production.txt"),
)
arkq added a commit that referenced this issue Mar 27, 2021

Unverified

This user has not yet uploaded their public signing key.
There is no standard name for the so called requirements.txt file.
Also, there is no standard location for such a file. From now, it
will be possible to specify file name/location from command line.

When a command line option with requirements text file is given, it
will disable requirements search in the setup.py and pyproject.toml
files.

Fixes #26 and resolves #33
@arkq arkq closed this as completed in 569de73 Mar 27, 2021
@arkq
Copy link
Owner

arkq commented Mar 27, 2021

I've added command line option --requirements-file=FILE. It's not based on glob pattern, but I hope it will suite you.

@Dreamsorcerer
Copy link
Contributor Author

Works nicely with a requirements-dev.txt file (which has a -r requirements.txt), thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants