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

feat: improve load_requirements in setup.py #2861

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

rbiseck3
Copy link
Contributor

@rbiseck3 rbiseck3 commented Apr 5, 2024

Description

This PR adds a number of enhancements around how we dynamically generate the requirements defined in the setup.py file. All logic around this was moved out into a setup_utils.py file to support unit tests around the logic:

  • load_requirements: Current approach to dynamically generate the requirements was causing them to maintain the newline character at the end. This was removed. Also added support for the -r character in *.in files which recursively pull in other .in files which would currently be ignored. This isn't being used at the moment so it wasn't causing a problem, but this is future looking. It also used to support a list of filenames but that was never used, isolated to take in only a string filename of a Path object.
  • New methods added to generate the dictionaries fo requirements, one for connector requirements and another for doc type requirements.
  • Safegaurds added throughout to raise an error if something incorrect was added. These include the file not being found or it not having the expected .in suffix.

@rbiseck3 rbiseck3 requested a review from qued April 5, 2024 12:51
setup.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
setup_utils.py Outdated Show resolved Hide resolved
@rbiseck3
Copy link
Contributor Author

rbiseck3 commented Apr 15, 2024

@qued, repo uploaded to test pypi here: unstructured/0.13.3.dev3/. This breaks through because it looks for all subsequent dependencies from the same test pypi index and they don't all exist there (i.e. langdetect). Need a way to tell pip to use test pypi index only for the unstructured package.

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

Successfully merging this pull request may close these issues.

None yet

2 participants