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

Make explicit cross-version support for Pydantic #64

Merged
merged 5 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.8", "3.11" ]
pydantic: [ "1", "2" ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -68,7 +69,7 @@ jobs:
run: pip install tox
- name: Test with pytest and generate coverage file
run:
tox run -e py
tox run -e py-pydantic${{ matrix.pydantic }}
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v1
if: success()
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ The most recent release can be installed from
$ pip install curies
```

This package currently supports both Pydantic v1 and v2. See the
[Pydantic migration guide](https://docs.pydantic.dev/2.0/migration/)
for updating your code.

## 👐 Contributing

Contributions, whether filing an issue, making a pull request, or forking, are appreciated. See
Expand Down
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
"sphinx_automodapi.automodapi",
"sphinx_automodapi.smart_resolver",
# 'texext',
Expand Down
4 changes: 4 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ The most recent code and data can be installed directly from GitHub with:

$ pip install git+https://github.com/cthoyt/curies.git

This package currently supports both Pydantic v1 and v2. See the
`Pydantic migration guide <https://docs.pydantic.dev/2.0/migration>`_
for updating your code.

.. toctree::
:maxdepth: 2
:caption: Contents:
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ keywords =
[options]
install_requires =
pytrie
pydantic<2.0
pydantic
requests

# Random options
Expand Down Expand Up @@ -87,9 +87,8 @@ fastapi =
rdflib =
rdflib
docs =
sphinx<7.0
sphinx
sphinx-rtd-theme
sphinx-autodoc-typehints
sphinx_automodapi

######################
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ envlist =
docstr-coverage
docs-test
# the actual tests
py
py-pydantic1
py-pydantic2
doctests
# always keep coverage-report last
# coverage-report
Expand All @@ -35,6 +36,9 @@ commands =
coverage run -p -m pytest --durations=20 {posargs:tests}
coverage combine
coverage xml
deps =
pydantic1: pydantic<2.0
pydantic2: pydantic>=2.0
extras =
tests
pandas
Expand Down
Loading