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

Reading requirements.txt in setup.py #2

Open
erelsgl opened this issue Feb 6, 2022 · 0 comments
Open

Reading requirements.txt in setup.py #2

erelsgl opened this issue Feb 6, 2022 · 0 comments

Comments

@erelsgl
Copy link

erelsgl commented Feb 6, 2022

In my setup.py, I read both the README.md and the requirements.txt:

  import setuptools, pathlib
  HERE = pathlib.Path(__file__).parent
  README = (HERE / "README.md").read_text()
  REQUIRES = (HERE / "requirements.txt").read_text().strip().split("\n")
  REQUIRES = [lin.strip() for lin in REQUIRES]
  
  setuptools.setup(
      ...
      install_requires=REQUIRES,
      long_description=README,
      long_description_content_type="text/markdown",
      ...
  )

For this to work, I had to add requirements.txt to MANIFEST.in.

I hope it helps someone.

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

1 participant