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

added post_install in setup.py file #3883

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

Conversation

christinestraub
Copy link
Collaborator

@christinestraub christinestraub commented Jan 22, 2025

  • Add auto-download for NLTK for Python Enviroment When user install python library without image, It will automatically download nltk data.

  • Added entry_points in setup in setup.py

@christinestraub christinestraub marked this pull request as ready for review January 23, 2025 15:13
setup.py Outdated
@@ -128,4 +128,9 @@ def load_requirements(file_list: Optional[Union[str, List[str]]] = None) -> List
},
package_dir={"unstructured": "unstructured"},
package_data={"unstructured": ["nlp/*.txt", "py.typed"]},
entry_points={
"console_scripts": [
"post_install_unstructured=unstructured.nlp.tokenize:download_nltk_packages"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this solution doesn't work for installing from .whl distribution though

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on new test environment. It worked.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added if condition in tokenize.py file to check flag and download NLTK_DATA

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.

2 participants