diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4752552..df9bee3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 .[tests] + python -m pip install flake8 .[tests,docs] - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -38,3 +38,6 @@ jobs: - name: Test with pytest run: | pytest tests -x -m "not dbtest" + - name: Try to build docs + run: | + mkdocs build --strict diff --git a/.github/workflows/update-requirements.yml b/.github/workflows/update-requirements.yml new file mode 100644 index 0000000..796e162 --- /dev/null +++ b/.github/workflows/update-requirements.yml @@ -0,0 +1,47 @@ +# This workflow will install Python dependencies and create a PR to update requirements.txt if needed +# The goal is to make sure that tests still run with newer dependencies versions, in order to allow +# lax dependencies versions. + +name: Update requirements.txt + +on: + schedule: + - cron: "34 3 8 * *" + workflow_dispatch: + +jobs: + update: + permissions: + contents: write + pull-requests: write + repository-projects: write + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install .[tests,docs] pyodbc psycopg2 pymysql duckdb_engine + - name: Update requirements.txt + run: | + pip freeze | grep -v 'xml2db' > requirements.txt + - name: Check changes and create pull request + run: | + if ! git diff --quiet --name-only --exit-code requirements.txt; then + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git checkout -b maintenance/update_requirements + git add requirements.txt + git commit -m "update requirements.txt" + git push -u origin maintenance/update_requirements + gh pr create --base main --head maintenance/update_requirements --title "Update requirements.txt" --body "Update requirements.txt with up to date dependencies versions." + else + echo "no changes, nothing to do." + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index d89ca70..dec8581 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "xml2db" -version = "0.12.3" +version = "0.12.4" authors = [ { name="Commission de régulation de l'énergie", email="opensource@cre.fr" }, ] @@ -18,12 +18,12 @@ classifiers = [ ] dependencies = [ "sqlalchemy>1.4", - "xmlschema==3.3.2", - "lxml==5.1.0", + "xmlschema>=3.3.2", + "lxml>=5.1.0", ] [project.optional-dependencies] -docs = ["mkdocs-material==9.5.34", "mkdocstrings-python==1.11.1"] +docs = ["mkdocs-material>=9.5.34", "mkdocstrings-python>=1.11.1"] tests = ["pytest>=7.0"] [project.urls]