Skip to content

Commit

Permalink
Merge pull request #45 from Project-OMOTES/44-update-to-latest-python…
Browse files Browse the repository at this point in the history
…-template

44: Update to latest python template.
  • Loading branch information
lfse-slafleur authored Dec 19, 2024
2 parents 97d1a14 + 237d279 commit 485dee7
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 53 deletions.
7 changes: 5 additions & 2 deletions ci/linux/create_venv.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env sh
#!/usr/bin/env bash

python3.12 -m venv ./.venv
. .venv/bin/activate
if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then
echo "Activating .venv first."
. .venv/bin/activate
fi
pip3 install pip-tools
2 changes: 1 addition & 1 deletion ci/linux/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then
echo "Activating .venv first."
Expand Down
3 changes: 2 additions & 1 deletion ci/linux/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash

if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then
echo "Activating .venv first."
. .venv/bin/activate
fi

flake8 ./src/omotes_rest ./unit_test/
3 changes: 2 additions & 1 deletion ci/linux/test_unit.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash

if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then
echo "Activating .venv first."
. .venv/bin/activate
fi

PYTHONPATH='$PYTHONPATH:src/' pytest --junit-xml=test-results.xml unit_test/
3 changes: 2 additions & 1 deletion ci/linux/typecheck.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash

if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then
echo "Activating .venv first."
. .venv/bin/activate
fi

python -m mypy ./src/omotes_rest ./unit_test/
6 changes: 3 additions & 3 deletions ci/linux/update_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash

if [[ "$OSTYPE" != "win32" && "$OSTYPE" != "msys" ]]; then
. .venv/bin/activate
fi

pip-compile -U --output-file=requirements.txt pyproject.toml
pip-compile -U --extra=dev -c requirements.txt --output-file=dev-requirements.txt pyproject.toml
pip-compile --upgrade --output-file=requirements.txt pyproject.toml
pip-compile --upgrade --extra=dev -c requirements.txt --output-file=dev-requirements.txt pyproject.toml
50 changes: 31 additions & 19 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --constraint=requirements.txt --extra=dev --output-file=dev-requirements.txt pyproject.toml
Expand All @@ -20,21 +20,23 @@ amqp==5.3.1
# via
# -c requirements.txt
# kombu
apispec[marshmallow]==6.7.1
apispec[marshmallow]==6.8.0
# via
# -c requirements.txt
# flask-smorest
attrs==24.2.0
# via flake8-bugbear
billiard==4.2.1
# via
# -c requirements.txt
# celery
black==22.1.0
black==24.10.0
# via omotes-rest (pyproject.toml)
blinker==1.9.0
# via
# -c requirements.txt
# flask
build==1.0.3
build==1.2.2.post1
# via omotes-rest (pyproject.toml)
celery==5.3.6
# via
Expand Down Expand Up @@ -65,20 +67,26 @@ colorama==0.4.6
# via
# -c requirements.txt
# omotes-rest (pyproject.toml)
coverage[toml]==7.6.8
coverage[toml]==7.6.9
# via pytest-cov
flake8==6.1.0
flake8==7.1.1
# via
# flake8-bugbear
# flake8-docstrings
# flake8-pyproject
# flake8-quotes
# flake8-tuple
# omotes-rest (pyproject.toml)
flake8-bugbear==24.10.31
# via omotes-rest (pyproject.toml)
flake8-docstrings==1.7.0
# via omotes-rest (pyproject.toml)
flake8-pyproject==1.2.3
# via omotes-rest (pyproject.toml)
flake8-quotes==3.4.0
# via omotes-rest (pyproject.toml)
flake8-tuple==0.4.1
# via omotes-rest (pyproject.toml)
flask==2.3.3
# via
# -c requirements.txt
Expand Down Expand Up @@ -117,6 +125,8 @@ idna==3.10
# yarl
iniconfig==2.0.0
# via pytest
isort==5.13.2
# via omotes-rest (pyproject.toml)
itsdangerous==2.2.0
# via
# -c requirements.txt
Expand All @@ -133,7 +143,7 @@ lxml==5.3.0
# via
# -c requirements.txt
# pyecore
mako==1.3.6
mako==1.3.8
# via
# -c requirements.txt
# alembic
Expand Down Expand Up @@ -166,7 +176,7 @@ multidict==6.1.0
# via
# -c requirements.txt
# yarl
mypy==1.5.1
mypy==1.13.0
# via
# omotes-rest (pyproject.toml)
# sqlalchemy
Expand All @@ -192,6 +202,7 @@ packaging==24.2
# via
# -c requirements.txt
# apispec
# black
# build
# gunicorn
# marshmallow
Expand All @@ -213,7 +224,7 @@ prompt-toolkit==3.0.48
# via
# -c requirements.txt
# click-repl
propcache==0.2.0
propcache==0.2.1
# via
# -c requirements.txt
# yarl
Expand All @@ -225,27 +236,27 @@ psycopg2-binary==2.9.10
# via
# -c requirements.txt
# omotes-rest (pyproject.toml)
pycodestyle==2.11.1
pycodestyle==2.12.1
# via flake8
pydocstyle==6.3.0
# via flake8-docstrings
pyecore==0.13.2
# via
# -c requirements.txt
# pyesdl
pyesdl==24.11.1
pyesdl==24.11.2
# via
# -c requirements.txt
# omotes-sdk-python
pyflakes==3.1.0
pyflakes==3.2.0
# via flake8
pyproject-hooks==1.2.0
# via build
pytest==7.3.2
pytest==8.3.4
# via
# omotes-rest (pyproject.toml)
# pytest-cov
pytest-cov==4.0.0
pytest-cov==6.0.0
# via omotes-rest (pyproject.toml)
python-dateutil==2.9.0.post0
# via
Expand All @@ -259,11 +270,12 @@ restrictedpython==7.4
# via
# -c requirements.txt
# pyecore
setuptools-git-versioning==1.13.6
setuptools-git-versioning==2.0.0
# via omotes-rest (pyproject.toml)
six==1.16.0
six==1.17.0
# via
# -c requirements.txt
# flake8-tuple
# python-dateutil
snowballstemmer==2.2.0
# via pydocstyle
Expand All @@ -280,8 +292,6 @@ structlog==23.1.0
# via
# -c requirements.txt
# omotes-rest (pyproject.toml)
tomli==2.2.1
# via black
types-flask-cors==5.0.0.20240902
# via omotes-rest (pyproject.toml)
types-protobuf==4.24.0.20240408
Expand Down Expand Up @@ -322,7 +332,9 @@ werkzeug==3.1.3
# -c requirements.txt
# flask
# flask-smorest
yarl==1.18.0
wheel==0.45.1
# via omotes-rest (pyproject.toml)
yarl==1.18.3
# via
# -c requirements.txt
# aio-pika
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
networks:
omotes:
external: true
mapeditor-net:
external: true
# mapeditor-net:
# external: true

volumes:
db-data:
Expand All @@ -12,7 +12,7 @@ services:
image: ghcr.io/project-omotes/omotes_rest:1.1.0
networks:
- omotes
- mapeditor-net
#- mapeditor-net
ports:
- "9200:9200"
environment:
Expand Down
41 changes: 26 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Physics",
]
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"

dependencies = [
"colorama ~= 0.4.6",
Expand All @@ -42,35 +42,46 @@ dependencies = [

[project.optional-dependencies]
dev = [
#"pip-tools~=6.13.0", # Installed via create_env script
"black ~= 22.1.0",
"flake8 ~= 6.0",
"Flake8-pyproject ~= 1.2",
"flake8-docstrings ~= 1.7",
"flake8-quotes ~= 3.3",
"pytest ~= 7.3.1",
"pytest-cov ~= 4.0.0",
"mypy ~= 1.5.1",
"build ~= 1.0.3",
"setuptools-git-versioning < 2",
"setuptools ~= 75.6.0",
"wheel ~= 0.45.1",
"setuptools-git-versioning >= 2.0, < 3",
"black ~= 24.10.0",
"flake8 == 7.1.1",
"flake8-pyproject ~= 1.2.3",
"flake8-docstrings ~= 1.7.0",
"flake8-quotes ~= 3.4.0",
"flake8-bugbear ~= 24.10.31",
"flake8-tuple ~= 0.4.1",
"pytest ~= 8.3.4",
"pytest-cov ~= 6.0.0",
"mypy ~= 1.13.0",
"isort == 5.13.2",
"build ~= 1.2.2",
"sqlalchemy[mypy]",
"types-protobuf ~= 4.24.0",
"types-Flask-Cors"
]

[project.urls]
"Homepage" = "https://github.com/pypa/sampleproject"
"Bug Tracker" = "https://github.com/pypa/sampleproject/issues"
homepage = "https://www.nwn.nu"
documentation = "https://readthedocs.org"
repository = "https://github.com/Nieuwe-Warmte-Nu/omotes-rest"
changelog = "https://github.com/Nieuwe-Warmte-Nu/omotes-rest /blob/main/CHANGELOG.md"

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools ~= 67.7.2", "wheel ~= 0.40.0", "setuptools-git-versioning<2"]
requires = [
"setuptools ~= 75.6.0",
"wheel ~= 0.45.1",
"setuptools-git-versioning >= 2.0, < 3",
]

[tools.setuptools]
packages = ["src/omotes_rest"]

[tool.setuptools-git-versioning]
enabled = true
starting_version = "0.0.1"

[tool.pytest.ini_options]
addopts = """--cov=omotes_rest --cov-report html --cov-report term-missing \
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements.txt pyproject.toml
Expand All @@ -12,7 +12,7 @@ alembic==1.13.3
# via omotes-rest (pyproject.toml)
amqp==5.3.1
# via kombu
apispec[marshmallow]==6.7.1
apispec[marshmallow]==6.8.0
# via flask-smorest
billiard==4.2.1
# via celery
Expand Down Expand Up @@ -63,7 +63,7 @@ kombu==5.4.2
# via celery
lxml==5.3.0
# via pyecore
mako==1.3.6
mako==1.3.8
# via alembic
markupsafe==3.0.2
# via
Expand Down Expand Up @@ -104,23 +104,23 @@ pamqp==3.3.0
# omotes-sdk-python
prompt-toolkit==3.0.48
# via click-repl
propcache==0.2.0
propcache==0.2.1
# via yarl
protobuf==4.25.5
# via omotes-sdk-protocol
psycopg2-binary==2.9.10
# via omotes-rest (pyproject.toml)
pyecore==0.13.2
# via pyesdl
pyesdl==24.11.1
pyesdl==24.11.2
# via omotes-sdk-python
python-dateutil==2.9.0.post0
# via celery
python-dotenv==1.0.1
# via omotes-rest (pyproject.toml)
restrictedpython==7.4
# via pyecore
six==1.16.0
six==1.17.0
# via python-dateutil
sqlalchemy==2.0.28
# via
Expand Down Expand Up @@ -155,7 +155,7 @@ werkzeug==3.1.3
# via
# flask
# flask-smorest
yarl==1.18.0
yarl==1.18.3
# via
# aio-pika
# aiormq
Expand Down

0 comments on commit 485dee7

Please sign in to comment.