Skip to content
Open
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
12 changes: 5 additions & 7 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand All @@ -25,13 +25,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Lint with flake8
poetry install --no-root
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
poetry run ruff check --select I pyevr --exclude pyevr/openapi_client
poetry run ruff check pyevr --exclude pyevr/openapi_client
- name: Test with pytest
run: |
poetry run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ ENV/
# Files for patching
pyevr/openapi/openapi-generator-compatible-patched.json
pyevr/openapi/openapi-generator-compatible.json
pyevr/openapi/openapi-generator-compatible.json.rej
pyevr/openapi/openapi-generator-compatible.json.orig
11 changes: 0 additions & 11 deletions .readthedocs.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

33 changes: 33 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,39 @@
Changelog
=========

1.0.1.dev3

**Generic**

* Update EVR schema to 1.4.0.1

1.0.1.dev2
----------

**Generic**

* Update EVR schema to 1.35 (from EVR test server, revision 2025-09-09)

1.0.0
----------

**BREAKING**

* Drop support for python 3.8

**Generic**

* Update to use newer openapi generator (pydantic 2)
* Improve `sanitize_for_serialization` for caching the data

**Updates**

Use EVR schema 1.30

* Support for EUDR fields
* Other misc changes


0.7.0
----------

Expand Down
63 changes: 33 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
.PHONY: clean clean-test clean-pyc clean-build docs help openapi
.DEFAULT_GOAL := help

OPENAPI_GENERATOR_VERSION ?= v7.0.1
OPENAPI_GENERATOR_VERSION ?= v7.12.0

.PHONY:
lint:
poetry run flake8 --select=E9,F63,F7,F82 pyevr
poetry run ruff check --select I pyevr --exclude pyevr/openapi_client
poetry run ruff check pyevr --exclude pyevr/openapi_client

.PHONY:
fmt:
poetry run black pyevr
poetry run black test
poetry run ruff check --select I pyevr --fix --exclude pyevr/openapi_client
poetry run ruff check pyevr --fix --exclude pyevr/openapi_client
poetry run ruff format pyevr --exclude pyevr/openapi_client

test: ## run tests quickly with the default Python
.PHONY:
test: # run tests quickly with the default Python
poetry run pytest

test-all: ## run tests on every Python version with tox
.PHONY:
test-all: # run tests on every Python version with tox
tox

coverage: ## check code coverage quickly with the default Python
coverage run --source pyevr -m pytest
coverage report -m
coverage html
.PHONY:
coverage: # check code coverage quickly with the default Python
poetry run coverage run --source pyevr -m pytest
poetry run coverage report -m
poetry run coverage html

release: dist ## package and upload a release
# todo
twine upload dist/*

dist: clean ## builds source and wheel package
# todo
python setup.py sdist
python setup.py bdist_wheel
ls -l dist

install: clean ## install the package to the active Python's site-packages
$ todo
python setup.py install

openapi-patch: ## create patch for openapi schema
.PHONY:
openapi-fetch:
curl https://evr.veoseleht.ee/api/openapi-generator-compatible.json -o pyevr/openapi/openapi-generator-compatible.json

.PHONY:
openapi-patch: openapi-fetch
diff -Naur ./pyevr/openapi/openapi-generator-compatible.json ./pyevr/openapi/openapi-generator-compatible-patched.json > ./pyevr/openapi/patches/schema-fixes.patch || echo "Patch created"

openapi: ## generate new API client based on the OpenAPI specification
.PHONY:
openapi-apply-patch: openapi-fetch
patch -p0 < pyevr/openapi/patches/schema-fixes.patch

.PHONY:
openapi-build:
rm -rf .openapi
rm -rf pyevr/openapi_client
rm -rf pyevr/docs
curl https://evr.veoseleht.ee/api/openapi-generator-compatible.json -o pyevr/openapi/openapi-generator-compatible.json
patch -p0 < pyevr/openapi/patches/schema-fixes.patch
docker run --rm --ulimit nofile=122880:122880 -v ${PWD}/pyevr/openapi/update_schema.sh:/helpers/update_schema.sh -v ${PWD}/pyevr/openapi/openapi-generator-compatible.json:/openapi-generator-compatible.json -v ${PWD}/.openapi/:/openapi openapitools/openapi-generator-cli:$(OPENAPI_GENERATOR_VERSION) /bin/bash /helpers/update_schema.sh /openapi-generator-compatible.json
sudo chown -R ${USER} .openapi
cp -r .openapi/openapi_client pyevr/openapi_client
cp -r .openapi/docs pyevr/docs
rm -rf .openapi
poetry run black pyevr
poetry run ruff check --select I pyevr/openapi_client --fix
poetry run ruff format pyevr/openapi_client

.PHONY:
openapi: openapi-apply-patch openapi-build
Loading