Skip to content

Commit

Permalink
Revert the pyproject.toml changes, replace CI pydantic check with an …
Browse files Browse the repository at this point in the history
…inplace sed to pin pydantic version to 1.0 (assuming the spec remains >=1.y.z for now)
  • Loading branch information
Lnaden committed Jul 31, 2023
1 parent 0820338 commit 9071102
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ jobs:
uses: actions/checkout@v3
- name: Install poetry
run: pip install poetry
- name: Install repo with Pydantic v2
run: poetry install --no-interaction --no-ansi
if: ${{ matrix.pydantic-version == 2 }}
# Force pydantic 1.0 by modifying poetry dep "pydantic" string with in-place sed
# -i '' is zero-length extension which does effectively in-place sub.
# ^ start of line, pydantic, optional spaces and > sign, capture the version, replace with ^{version}
# Should avoid also replacing the autodoc-pydantic spec later on.
- name: Install repo with Pydantic v1
run: poetry install --no-interaction --no-ansi --without pydantic --with pydanticv1
run: |
sed -i '' 's/^pydantic *= *">*= *\([0-9.]*\)"/pydantic = "^\1"/' pyproject.toml
if: ${{ matrix.pydantic-version == 1 }}
- name: Install repo with poetry
run: poetry install --no-interaction --no-ansi
- name: Run tests
run: poetry run pytest -rws -v --cov=qcelemental --color=yes --cov-report=xml
- name: Upload coverage to Codecov
Expand Down
12 changes: 1 addition & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,13 @@ numpy = [
]
python = "^3.7"
pint = ">=0.10.0"
pydantic = ">=1.8.2"
nglview = { extras = ["viz"], version = "^3.0.3" }
ipykernel = { version = "<6.0.0", extras = ["viz"] }
importlib-metadata = { version = ">=4.8", python = "<3.8" }
networkx = { version = "<3.0", extras = ["align"] }
pytest = { extras = ["test"], version = "^7.2.2" }

[tool.poetry.group.pydantic.dependencies]
pydantic = "^2.0"

[tool.poetry.group.pydanticv1]
optional = true

[tool.poetry.group.pydanticv1.dependencies]
pydantic = "^1.8.2"




[tool.poetry.group.dev.dependencies]
black = ">=23.1.0"
Expand Down

0 comments on commit 9071102

Please sign in to comment.