Skip to content

Commit

Permalink
Merge pull request #82 from open-zaak/deps/django42
Browse files Browse the repository at this point in the history
⬆️ bump django to 4.2, update python
  • Loading branch information
annashamray authored Apr 12, 2024
2 parents 534e4eb + 2cd76d3 commit 177e349
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 27 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10']
django: ['3.2']
python: ['3.10', '3.11']
django: ['3.2', '4.2']
binding: ['BROWSER', 'WEBSERVICE']
cmisurlmapping: [ 'False', 'True' ]
exclude:
Expand All @@ -26,8 +26,8 @@ jobs:
name: Tests (Py${{ matrix.python }}, Django ${{ matrix.django }}, ${{ matrix.binding }}, URL mapping = ${{ matrix.cmisurlmapping }})

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down Expand Up @@ -56,18 +56,18 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'

- name: Build sdist and wheel
run: |
pip install pip setuptools wheel --upgrade
python setup.py sdist bdist_wheel
pip install build --upgrade
python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.1
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
matrix:
toxenv: [isort, black, flake8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.10'
- name: Install dependencies
run: pip install tox
- run: tox
Expand Down
6 changes: 3 additions & 3 deletions drc_cmis/browser/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ def create_content_object(
if "cmis:objectTypeId" in properties.keys():
json_data["propertyValue[2]"] = properties.pop("cmis:objectTypeId")
else:
json_data[
"propertyValue[2]"
] = f"{self.get_object_type_id_prefix(object_type)}drc:{object_type}"
json_data["propertyValue[2]"] = (
f"{self.get_object_type_id_prefix(object_type)}drc:{object_type}"
)

prop_count = 3
for prop_key, prop_value in properties.items():
Expand Down
2 changes: 1 addition & 1 deletion drc_cmis/client_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

try:
from zgw_consumers.client import get_client_class
except ImportError:
except (ImportError, RuntimeError):

def get_client_class() -> Type[Client]:
return Client
Expand Down
1 change: 1 addition & 0 deletions drc_cmis/notifications.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Listen to the notifications that are send by the NRC
"""

from vng_api_common.notifications.handlers import RoutingHandler, default

from drc_cmis.client_builder import get_cmis_client, get_zds_client
Expand Down
4 changes: 2 additions & 2 deletions drc_cmis/utils/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def parseDateTimeValue(value):
"""
Utility function to return a datetime from a string.
"""
if type(value) == str:
if isinstance(value, str):
return iso8601.parse_date(value)
elif type(value) == int:
elif isinstance(value, int):
return datetime.fromtimestamp(value / 1000)
else:
return None
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ classifiers =
Development Status :: 5 - Production/Stable
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 4.2
Intended Audience :: Developers
Operating System :: Unix
Operating System :: MacOS
Expand All @@ -30,7 +31,7 @@ zip_safe = False
include_package_data = True
packages = find:
install_requires =
django>=3.2.0,<4.0
django>=3.2.0
cmislib-maykin >= 0.7.2.dev0
django-solo
iso8601
Expand Down
15 changes: 8 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{37,38,39,310}-django32-{browser,webservice,urlmapping}
py{310,311}-django{32,42}-{browser,webservice,urlmapping}
isort
black
flake8
Expand All @@ -9,22 +9,21 @@ skip_missing_interpreters = true

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[gh-actions:env]
DJANGO =
3.2: django32
4.2: django42

CMIS_BINDING =
BROWSER: browser
WEBSERVICE: webservice
WEBSERVICE: py{37,38,39,310}-django32-urlmapping
WEBSERVICE: py{310,311}-django{32,42}-urlmapping

CMIS_URL_MAPPING_ENABLED =
True: py{37,38,39,310}-django32-urlmapping
True: py{310,311}-django{32,42}-urlmapping

[testenv]
passenv =
Expand All @@ -38,12 +37,13 @@ extras =
coverage
deps =
django32: Django~=3.2.0
django42: Django~=4.2.0
commands =
py.test tests/ \
--cov=drc_cmis --cov-report xml:reports/coverage-{envname}.xml \
{posargs}

[testenv:py{37,38,39,310}-django32-urlmapping]
[testenv:py{310,311}-django{32,42}-urlmapping]
passenv =
CI
CMIS_BINDING
Expand All @@ -56,6 +56,7 @@ extras =
coverage
deps =
django32: Django~=3.2.0
django42: Django~=4.2.0
commands =
py.test tests/ \
--cov=drc_cmis --cov-report xml:reports/coverage-{envname}.xml \
Expand Down

0 comments on commit 177e349

Please sign in to comment.