-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(CVE-2024-39705): remove nltk download #3361
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
4db6a51
first pass on download function
MthwRobinson 389e90b
make tidy
MthwRobinson 2c2e297
use tempfile for download tar
MthwRobinson ae91039
update logic for checking if packages available
MthwRobinson a4e6560
cleanup sha256 check
MthwRobinson e6be633
raise if nltk.download is invoked
MthwRobinson e9c030b
changelog and version
MthwRobinson 357f8f0
linting, linting, linting
MthwRobinson d7368b3
Revert "cleanup sha256 check"
MthwRobinson f4d424c
update tokenize tests
MthwRobinson 3155c32
fix raise on nltk download args
MthwRobinson 2ee94e6
Merge branch 'main' into fix/remove-nltk-download
MthwRobinson 4237f95
proposed changes
scanny 5a2e99a
add docstring
MthwRobinson 2a58486
code path for when directory dir is None
MthwRobinson 9b0b3a6
fix typo
MthwRobinson 93ca1c3
linting, linting, linting
MthwRobinson fca525b
update to new wolfi base image
MthwRobinson 222c5a4
add NLTK_DATA env var to ingest unit
MthwRobinson 5b00529
bump version
MthwRobinson f6a8394
use new function to download nltk packages in dockerfile
MthwRobinson a598ea8
fix nltk_data_dir check
MthwRobinson e8816bd
Merge branch 'main' into fix/remove-nltk-download
MthwRobinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from nltk import data, internals | ||
| from nltk.data import find | ||
| from nltk.downloader import download | ||
| from nltk.tag import pos_tag | ||
| from nltk.tokenize import sent_tokenize, word_tokenize | ||
|
|
||
| __all__ = [ | ||
| "data", | ||
| "download", | ||
| "find", | ||
| "internals", | ||
| "pos_tag", | ||
| "sent_tokenize", | ||
| "word_tokenize", | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import Sequence | ||
|
|
||
| path: list[str] | ||
|
|
||
| def find(resource_name: str, paths: Sequence[str] | None = None) -> str: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import Callable | ||
|
|
||
| download: Callable[..., bool] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from __future__ import annotations | ||
|
|
||
| def is_writable(path: str) -> bool: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from __future__ import annotations | ||
|
|
||
| def pos_tag( | ||
| tokens: list[str], tagset: str | None = None, lang: str = "eng" | ||
| ) -> list[tuple[str, str]]: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| from __future__ import annotations | ||
|
|
||
| def sent_tokenize(text: str, language: str = ...) -> list[str]: ... | ||
| def word_tokenize(text: str, language: str = ..., preserve_line: bool = ...) -> list[str]: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| __version__ = "0.14.10-dev13" # pragma: no cover | ||
| __version__ = "0.14.10" # pragma: no cover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.