Skip to content

Commit

Permalink
build: move numpy pin to packaging (#3296)
Browse files Browse the repository at this point in the history
Moved numpy pin to `base.in` where it will be picked up by packaging.

Side note:
`constraints.txt` (formerly `constraints.in`) is a really useful
pattern: you put a constraint there, add that file as a `-c` requirement
in other files, and the constraint will be applied when pip-compiling
*only when needed* because the library is required by something else.
Neat! However, unfortunately, in my searches I've never found a similar
pattern for packaging, so any pins we want to propagate to user installs
need to be explicitly placed in the `.in` files.

So what is `constraints.txt` really doing for us? Well in the past I
think there have been instances where something is temporarily broken in
an upstream dependency but we expect it to be patched soon, but in the
meantime we want things to work in our CI builds and development
installs, so it's not worth pinning everywhere it's used. Having said
that, I'm coming to the conclusion that `constraints.txt` causes more
harm than good in the confusion it causes WRT packaging -- maybe we
should remove that pattern at some point.
  • Loading branch information
qued committed Jun 25, 2024
1 parent c32aeaa commit 0665e94
Show file tree
Hide file tree
Showing 20 changed files with 7 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 0.14.9-dev2
## 0.14.9-dev4

### Enhancements

Expand Down
4 changes: 3 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ emoji
dataclasses-json
python-iso639
langdetect
numpy
# NOTE(robinson) - pinned due to a feature being deprecated in the latest version. plan to
# investigate and remove pin
numpy<2
rapidfuzz
backoff
typing-extensions
Expand Down
4 changes: 1 addition & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ mypy-extensions==1.0.0
nltk==3.8.1
# via -r ./base.in
numpy==1.26.4
# via
# -c ././deps/constraints.txt
# -r ./base.in
# via -r ./base.in
packaging==23.2
# via
# -c ././deps/constraints.txt
Expand Down
3 changes: 0 additions & 3 deletions requirements/deps/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ unstructured-client<=0.18.0
fsspec==2024.5.0

# python 3.12 support
# NOTE(robinson) - pinned due to a feature being deprecated in the latest version. plan to
# investigate and remove pin
numpy==1.26.4
wrapt>=1.14.0


Expand Down
1 change: 0 additions & 1 deletion requirements/extra-csv.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#
numpy==1.26.4
# via
# -c ././deps/constraints.txt
# -c ./base.txt
# pandas
pandas==2.2.2
Expand Down
1 change: 0 additions & 1 deletion requirements/extra-paddleocr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ networkx==3.2.1
# via scikit-image
numpy==1.26.4
# via
# -c ././deps/constraints.txt
# -c ./base.txt
# contourpy
# imageio
Expand Down
1 change: 0 additions & 1 deletion requirements/extra-pdf-image.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ networkx==3.2.1
# via torch
numpy==1.26.4
# via
# -c ././deps/constraints.txt
# -c ./base.txt
# contourpy
# layoutparser
Expand Down
1 change: 0 additions & 1 deletion requirements/extra-xlsx.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ networkx==3.2.1
# via -r ./extra-xlsx.in
numpy==1.26.4
# via
# -c ././deps/constraints.txt
# -c ./base.txt
# pandas
openpyxl==3.1.4
Expand Down
1 change: 0 additions & 1 deletion requirements/huggingface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ networkx==3.2.1
# via torch
numpy==1.26.4
# via
# -c ././deps/constraints.txt
# -c ./base.txt
# transformers
packaging==23.2
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/astra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ idna==3.7
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# cassio
packaging==23.2
# via
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/chroma.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ mpmath==1.3.0
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# chroma-hnswlib
# chromadb
# onnxruntime
Expand Down
3 changes: 1 addition & 2 deletions requirements/ingest/clarifai.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ charset-normalizer==3.3.2
# requests
clarifai==10.5.2
# via -r ./ingest/clarifai.in
clarifai-grpc==10.5.3
clarifai-grpc==10.5.4
# via clarifai
contextlib2==21.6.0
# via schema
Expand All @@ -36,7 +36,6 @@ mdurl==0.1.2
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# clarifai
# tritonclient
pfzy==0.3.4
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/delta-table.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ fsspec==2024.5.0
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# pyarrow
pyarrow==16.1.0
# via deltalake
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/embed-aws-bedrock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ mypy-extensions==1.0.0
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# langchain
# langchain-community
orjson==3.10.5
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/embed-huggingface.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ networkx==3.2.1
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# langchain
# langchain-community
# scikit-learn
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/embed-openai.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ mypy-extensions==1.0.0
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# langchain
# langchain-community
openai==1.35.3
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/embed-vertexai.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ mypy-extensions==1.0.0
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# langchain
# langchain-community
# shapely
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/embed-voyageai.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ multidict==6.0.5
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# langchain
# voyageai
orjson==3.10.5
Expand Down
1 change: 0 additions & 1 deletion requirements/ingest/qdrant.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ idna==3.7
numpy==1.26.4
# via
# -c ./ingest/../base.txt
# -c ./ingest/../deps/constraints.txt
# qdrant-client
portalocker==2.10.0
# via qdrant-client
Expand Down
2 changes: 1 addition & 1 deletion unstructured/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.14.9-dev2" # pragma: no cover
__version__ = "0.14.9-dev4" # pragma: no cover

0 comments on commit 0665e94

Please sign in to comment.