Skip to content

Commit

Permalink
Always require pydantic<2 when building manylinux and musllinux wheels
Browse files Browse the repository at this point in the history
Cleaned up requirements
Improved documentation of requirements
  • Loading branch information
jesper-friis committed Aug 18, 2023
1 parent 21f4e09 commit 4c015ed
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/docker/Dockerfile-manylinux.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ARG PY_MINORS="7 8 9 10 11"

#COPY requirements.txt /tmp/requirements.txt
COPY requirements_full.txt /tmp/requirements_full.txt
COPY requirements_full.txt /tmp/requirements_dev.txt

{{ EXTRA_PRE }}

Expand All @@ -50,13 +51,17 @@ RUN yum update -y && \
# exist here.
cd /opt/_internal && \
tar -Jxvf static-libs-for-embedding-only.tar.xz && \
# Change required version of pydantic to be <2
sed 's/^\(pydantic>.*<\).*$/\12/' -i /tmp/requirements_full.txt && \
# Install required Python packages
mkdir -p /ci/pip_cache && \
if [ -f "/etc/yum.repos.d/pgdg-91.repo" ]; then export PATH="$PATH:/usr/pgsql-9.1/bin"; fi && \
for minor in ${PY_MINORS}; do \
python3.${minor} -m pip install -U pip && \
python3.${minor} -m pip install -U setuptools wheel && \
python3.${minor} -m pip install -U --cache-dir /ci/pip_cache cmake oldest-supported-numpy && \
python3.${minor} -m pip install --cache-dir /ci/pip_cache --prefer-binary -r /tmp/requirements_full.txt; \
python3.${minor} -m pip install --cache-dir /ci/pip_cache --prefer-binary -r /tmp/requirements_dev.txt; \
done

{{ EXTRA_POST }}
5 changes: 5 additions & 0 deletions .github/docker/Dockerfile-musllinux.template
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ FROM quay.io/pypa/musllinux{{ TYPE }}_{{ ARCH }}:latest

#COPY requirements.txt /tmp/requirements.txt
COPY requirements_full.txt /tmp/requirements_full.txt
COPY requirements_full.txt /tmp/requirements_dev.txt

# Do not use distutils distributed with setuptools
# This is due to base changes in the distutils API, removing msvccompiler,
Expand All @@ -41,10 +42,14 @@ RUN apk add -u \
# exist here.
cd /opt/_internal && \
tar -Jxvf static-libs-for-embedding-only.tar.xz && \
# Change required version of pydantic to be <2
sed 's/^\(pydantic>.*<\).*$/\12/' -i /tmp/requirements_full.txt && \
# Install required Python packages
mkdir -p /ci/pip_cache && \
for minor in 7 8 9 10; do \
python3.${minor} -m pip install -U pip && \
python3.${minor} -m pip install -U setuptools wheel && \
python3.${minor} -m pip install -U --cache-dir /ci/pip_cache cmake oldest-supported-numpy && \
python3.${minor} -m pip install --cache-dir /ci/pip_cache --prefer-binary -r /tmp/requirements_full.txt; \
python3.${minor} -m pip install --cache-dir /ci/pip_cache --prefer-binary -r /tmp/requirements_dev.txt; \
done
33 changes: 27 additions & 6 deletions doc/getting_started/build/runtime_dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,45 @@ On Ubuntu, they can be installed with
sudo apt install python3 gfortran librdf libhdf5

When DLite is compiled with Python bindings, additional runtime features may be enabled by installing one of more of the following optional Python packages
- [tripper], optional, (used for property mappings)
- [PyYAML], optional (used for generic YAML storage plugin)
- [psycopg2], optional (used for generic PostgreSQL storage plugin)
- [tripper], used for property mappings
- [pint], used for units conversion in property mappings
- [pydantic], used for testing support for pydantic models
- [typing_extensions], needed by pydantic v2
- [rdflib], used by `rdf` storage plugin
- [PyYAML], used by `yaml` storage plugin
- [psycopg2], used by `postgresql` storage plugin
Note that in some cases a GSSAPI error is raised when using psycopg2
by pip installing psycopg2-binary.
This is solved by installing from source as described in their documentation.
- [pandas], optional (used for csv storage plugin)
- [pymongo], optional, (used for mongodb storage plugin)
- [mongomock], optional, used for testing mongodb storage plugin.
- [pandas], used by the `csv` storage plugin
- [requests], used by `http` storage plugin
- [jinja2], used by `template` storage plugin
- [pymongo], used by the `mongodb` storage plugin

These optional dependencies can be installed with

pip install -r requirements_full.txt

Separate requirements can also be installed for development

pip install -r requirements_dev.txt

or for building the documentation

pip install -r requirements_doc.txt



[tripper]: https://pypi.org/project/tripper/
[pint]: https://pint.readthedocs.io/en/stable/
[pydantic]: https://docs.pydantic.dev/
[typing_extensions]: https://github.com/python/typing_extensions
[rdflib]: https://rdflib.readthedocs.io/
[PyYAML]: https://pypi.org/project/PyYAML/
[psycopg2]: https://pypi.org/project/psycopg2/
[pandas]: https://pandas.pydata.org/
[pymongo]: https://github.com/mongodb/mongo-python-driver
[mongomock]: https://github.com/mongomock/mongomock
[openpyxl]: https://openpyxl.readthedocs.io/
[requests]: https://requests.readthedocs.io/
[jinja2]: https://jinja.palletsprojects.com/
19 changes: 16 additions & 3 deletions doc/getting_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,34 @@ Installing with pip
If you are using Python, the easiest way to install DLite is with pip:

```shell
pip install DLite-Python
pip install DLite-Python[full]
```

This will give you DLite together with all optional Python dependencies (see [runtime dependencies]).
The bracket `[full]` is optional, but ensures that you install DLite
together with all optional dependencies needed for additional features
and storage plugins. (see also [runtime dependencies]).


Development installation
------------------------
If you to contribute or develop DLite, you should [build from source].

Python dependencies for development can be installed with

```shell
pip install DLite-Python[dev]
```

Install additional Python packages for building documentation with

```shell
pip install DLite-Python[doc]
```


[Python]: https://www.python.org/
[Fortran]: https://en.wikipedia.org/wiki/Fortran
[HDF5]: https://support.hdfgroup.org/HDF5/
[librdf]: https://librdf.org/
[runtime dependencies]: https://sintef.github.io/dlite/getting_started/build/runtime-dependencies.html
[runtime dependencies]: https://sintef.github.io/dlite/getting_started/build/runtime_dependencies.html
[build from source]: https://sintef.github.io/dlite/getting_started/build/build.html
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ ipython>=7.34.0,<9
ipykernel>=6.0.1,<7
ipython_genutils~=0.2.0
mongomock>=4.1.2,<5
pydantic>=1.9.0,<2
openpyxl>=3.0.9,<3.2
1 change: 0 additions & 1 deletion requirements_full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ psycopg2-binary==2.9.5
pandas>=1.2,<2.1
rdflib>=4.2.1,<7
pint>=0.15,<1
openpyxl>=3.0.9,<3.2
pymongo>=4.4.0,<5
tripper>=0.2.5,<0.3
requests>=2.10,<3
Expand Down

0 comments on commit 4c015ed

Please sign in to comment.