Skip to content

Commit 306521c

Browse files
committed
new github actions
1 parent ec3f332 commit 306521c

File tree

2 files changed

+62
-53
lines changed

2 files changed

+62
-53
lines changed

.github/workflows/main.yaml

+57-52
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,66 @@
1-
name: Unit Tests
1+
name: CI
22

33
on:
4-
push:
5-
branches: [ "master", "dev" ]
6-
pull_request:
7-
branches: [ "master", "dev" ]
4+
push: { branches: [master, dev] }
5+
pull_request: { branches: [master, dev] }
86

97
jobs:
108
build:
11-
env:
12-
DEFAULT_PYTHON: 3.12
139
runs-on: ubuntu-latest
10+
env:
11+
DEFAULT_PYTHON: '3.12'
1412
strategy:
1513
matrix:
16-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17-
architecture: ["x64"]
14+
python-version: ['3.9','3.10','3.11','3.12','3.13']
15+
architecture: ['x64']
16+
1817
steps:
19-
- uses: actions/checkout@v2
20-
- name: Setup Python ${{ matrix.python-version }} on ${{ matrix.architecture }}
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: ${{ matrix.python-version }}
24-
architecture: ${{ matrix.architecture }}
25-
- name: Cache pip
26-
env:
27-
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: "1"
28-
uses: actions/cache@v4
29-
with:
30-
restore-keys: |
31-
${{ runner.os }}-
32-
- name: Upgrade setuptools
33-
if: matrix.python-version >= 3.12
34-
run: |
35-
# workaround for 3.12, SEE: https://github.com/pypa/setuptools/issues/3661#issuecomment-1813845177
36-
pip install --upgrade setuptools
37-
- name: Lint with flake8
38-
if: matrix.python-version == ${{ env.DEFAULT_PYTHON }}
39-
run: |
40-
# stop the build if there are Python syntax errors or undefined names
41-
nox -e flake8 -- deepdiff --count --select=E9,F63,F7,F82 --show-source --statistics
42-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43-
nox -e flake8 -- deepdiff --count --exit-zero --max-complexity=26 --max-line-length=250 --statistics
44-
- name: Test with pytest and get the coverage
45-
if: matrix.python-version == ${{ env.DEFAULT_PYTHON }}
46-
run: |
47-
nox -e pytest -s -- --benchmark-disable --cov-report=xml --cov=deepdiff tests/ --runslow
48-
- name: Test with pytest and no coverage report
49-
if: matrix.python-version != ${{ env.DEFAULT_PYTHON }}
50-
run: |
51-
nox -e pytest -s -- --benchmark-disable tests/
52-
- name: Upload coverage to Codecov
53-
uses: codecov/codecov-action@v4
54-
if: matrix.python-version == ${{ env.DEFAULT_PYTHON }}
55-
env:
56-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
57-
with:
58-
file: ./coverage.xml
59-
token: ${{ secrets.CODECOV_TOKEN }}
60-
env_vars: OS,PYTHON
61-
fail_ci_if_error: true
18+
- uses: actions/checkout@v3
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
architecture: ${{ matrix.architecture }}
25+
cache: pip
26+
cache-dependency-path: pyproject.toml
27+
28+
- name: Install nox
29+
run: pip install nox
30+
- name: Upgrade setuptools & wheel (for all venvs)
31+
run: pip install --upgrade setuptools wheel
32+
33+
- name: Lint with flake8
34+
if: ${{ matrix.python-version == env.DEFAULT_PYTHON }}
35+
run: |
36+
nox -e flake8 -- \
37+
deepdiff \
38+
--count --select=E9,F63,F7,F82 \
39+
--show-source --statistics
40+
nox -e flake8 -- \
41+
deepdiff \
42+
--count --exit-zero \
43+
--max-complexity=26 --max-line-length=250 \
44+
--statistics
45+
46+
- name: Test with pytest (coverage)
47+
if: ${{ matrix.python-version == env.DEFAULT_PYTHON }}
48+
run: |
49+
nox -e pytest -- \
50+
--benchmark-disable \
51+
--cov-report=xml \
52+
--cov=deepdiff \
53+
tests/ --runslow
54+
55+
- name: Test with pytest (no coverage)
56+
if: ${{ matrix.python-version != env.DEFAULT_PYTHON }}
57+
run: nox -e pytest -- --benchmark-disable tests/
58+
59+
- name: Upload coverage
60+
if: ${{ matrix.python-version == env.DEFAULT_PYTHON }}
61+
uses: codecov/codecov-action@v4
62+
with:
63+
token: ${{ secrets.CODECOV_TOKEN }}
64+
file: coverage.xml
65+
env_vars: OS,PYTHON
66+
fail_ci_if_error: true

pyproject.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "flit_core.buildapi"
66
name = "deepdiff"
77
version = "8.4.2"
88
dependencies = [
9-
"orderly-set>=5.3.0,<6",
9+
"orderly-set>=5.4.1,<6",
1010
]
1111
requires-python = ">=3.9"
1212
authors = [
@@ -54,6 +54,7 @@ dev = [
5454
"tomli-w~=1.2.0",
5555
"pandas~=2.2.0",
5656
"polars~=1.21.0",
57+
"nox==2025.5.1",
5758
]
5859
docs = [
5960
# We use the html style that is not supported in Sphinx 7 anymore.
@@ -73,6 +74,9 @@ test = [
7374
"pytest-cov~=6.0.0",
7475
"python-dotenv~=1.0.0",
7576
]
77+
optimize = [
78+
"orjson",
79+
]
7680

7781
[project.scripts]
7882
deep = "deepdiff.commands:cli"

0 commit comments

Comments
 (0)