From 974c609038664b7db3a10bbad3665cad186beeb6 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Thu, 27 Mar 2025 23:52:18 +0100 Subject: [PATCH 01/27] ci --- .github/actions/generate/action.yml | 18 +++++-- .github/workflows/pypi-test.yml | 76 +++++++++++------------------ .github/workflows/release.yml | 59 +++++++--------------- 3 files changed, 60 insertions(+), 93 deletions(-) diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml index c8b9a01..07cd7ad 100644 --- a/.github/actions/generate/action.yml +++ b/.github/actions/generate/action.yml @@ -26,19 +26,29 @@ runs: using: "composite" steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch the entire history to avoid shallow repository issues - name: Download ETP file run : wget http://geosiris.com/wp-content/uploads/2022/09/etp/${{ inputs.etp-file-name }} -P ${{ github.workspace }} shell: bash - - name: Install dependencies - uses: ./.github/actions/prepare-poetry + - name: 🐍 Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + + - name: 💾 Cache Poetry dependencies + uses: actions/cache@v3 with: - python-version: ${{ inputs.python-version }} + path: ~/.cache/pypoetry + key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}- - name: Install avro-to-python-etp run: | - poetry run python -m pip install avro-to-python-etp + poetry add -D avro-to-python-etp shell: bash - name: Translate avpr to avsc diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 0cc762c..51136f5 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -16,11 +16,14 @@ env: jobs: build: - name: Building generated code + name: Building and push generated code runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: 📥 Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch the entire history to avoid shallow repository issues - name: Generate code from avro-to-python-etp uses: ./.github/actions/generate @@ -29,18 +32,36 @@ jobs: dest-folder: ${{ env.GENERATED_CODE_FOLDER }} etp-file-name: ${{ secrets.ETP_FILE_NAME }} - - name: Install dependencies - uses: ./.github/actions/prepare-poetry + - name: 🐍 Set up Python + uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} - toml-path: ${{ env.GENERATED_CODE_FOLDER }} + + - name: 💾 Cache Poetry dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pypoetry + key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}- - name: Python Black run: | cd ${{ env.GENERATED_CODE_FOLDER }} poetry run black etptypes - - name: Build Etptypes-python + - name: 📦 Install poetry-dynamic-versioning + run: poetry add -D poetry-dynamic-versioning[plugin] + + - name: 📥 Install dependencies + run: poetry install --no-interaction --no-root + + - name: Configure Poetry with PyPI repository and token + run: | + poetry config repositories.test-pypi https://test.pypi.org/legacy/ + poetry config pypi-token.test-pypi ${{ secrets.POETRY_PYPI_TEST_TOKEN_VALUE }} + + - name: 🛠️ Build the package run: | cd ${{ env.GENERATED_CODE_FOLDER }} rm pyproject.toml @@ -49,46 +70,7 @@ jobs: cp ${{ github.workspace }}/README.md . poetry build - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: dist-artifact - retention-days: 1 - path: | - ${{ env.GENERATED_CODE_FOLDER }}/dist - ${{ env.GENERATED_CODE_FOLDER }}/pyproject.toml - ${{ env.GENERATED_CODE_FOLDER }}/LICENSE - ${{ env.GENERATED_CODE_FOLDER }}/README.md - - publish: - needs: build - - name: Publish to PyPI-test - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Get build artifacts - uses: actions/download-artifact@v4 - with: - name: dist-artifact - path: ${{ env.GENERATED_CODE_FOLDER }} - - - name: Install dependencies - uses: ./.github/actions/prepare-poetry - with: - python-version: ${{ matrix.python-version }} - toml-path: ${{ env.GENERATED_CODE_FOLDER }} - - - name: Upload to PyPI TEST + - name: 🚀 Publish to PyPI run: | cd ${{ env.GENERATED_CODE_FOLDER }} - poetry config repositories.test https://test.pypi.org/legacy/ - poetry config http-basic.test ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} ${{ secrets.POETRY_TEST_PYPI_TOKEN_PASSWORD}} - poetry publish --repository test \ No newline at end of file + poetry publish --repository test-pypi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 927cef6..ce5ee98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: 📥 Checkout repository + uses: actions/checkout@v4 - name: Generate code from avro-to-python-etp uses: ./.github/actions/generate @@ -40,7 +41,18 @@ jobs: cd ${{ env.GENERATED_CODE_FOLDER }} poetry run black etptypes - - name: Build Etptypes-python + - name: 📦 Install poetry-dynamic-versioning + run: poetry add -D poetry-dynamic-versioning[plugin] + + - name: 📥 Install dependencies + run: poetry install --no-interaction --no-root + + - name: Configure Poetry with PyPI repository and token + run: | + poetry config repositories.test-pypi https://test.pypi.org/legacy/ + poetry config pypi-token.test-pypi ${{ secrets.POETRY_PYPI_TEST_TOKEN_VALUE }} + + - name: 🛠️ Build the package run: | cd ${{ env.GENERATED_CODE_FOLDER }} rm pyproject.toml @@ -49,44 +61,7 @@ jobs: cp ${{ github.workspace }}/README.md . poetry build - - name: Archive production artifacts - uses: actions/upload-artifact@v4 - with: - name: dist-artifact - retention-days: 1 - path: | - ${{ env.GENERATED_CODE_FOLDER }}/dist - ${{ env.GENERATED_CODE_FOLDER }}/pyproject.toml - ${{ env.GENERATED_CODE_FOLDER }}/LICENSE - ${{ env.GENERATED_CODE_FOLDER }}/README.md - - publish: - needs: build - - name: Publish to PyPI-test - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Get build artifacts - uses: actions/download-artifact@v4 - with: - name: dist-artifact - path: ${{ env.GENERATED_CODE_FOLDER }} - - - name: Install dependencies - uses: ./.github/actions/prepare-poetry - with: - python-version: ${{ matrix.python-version }} - toml-path: ${{ env.GENERATED_CODE_FOLDER }} - - - name: Upload to PyPI TEST + - name: 🚀 Publish to PyPI run: | - cd ${{ env.GENERATED_CODE_FOLDER }} - poetry publish --username ${{ secrets.POETRY_PYPI_TOKEN_USERNAME}} --password ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD}} \ No newline at end of file + poetry config pypi-token.pypi ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD }} + poetry publish \ No newline at end of file From 66c6e28f4cbf35d9bd523319117958606b611d9d Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Thu, 27 Mar 2025 23:55:53 +0100 Subject: [PATCH 02/27] --- --- .github/actions/generate/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml index 07cd7ad..5a320f9 100644 --- a/.github/actions/generate/action.yml +++ b/.github/actions/generate/action.yml @@ -35,8 +35,8 @@ runs: - name: 🐍 Set up Python uses: actions/setup-python@v4 - with: - python-version: ${{ inputs.python-version }} + with: + python-version: ${{ inputs.python-version }} - name: 💾 Cache Poetry dependencies uses: actions/cache@v3 From bf0ca7944258c46e6177df2b3a9bdab3b20dfda9 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Thu, 27 Mar 2025 23:58:10 +0100 Subject: [PATCH 03/27] -- --- .github/actions/generate/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml index 5a320f9..3a7d4ce 100644 --- a/.github/actions/generate/action.yml +++ b/.github/actions/generate/action.yml @@ -34,7 +34,7 @@ runs: shell: bash - name: 🐍 Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v4 with: python-version: ${{ inputs.python-version }} From f946e596c04145609ae54bb46f86a8d1c105d459 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Fri, 28 Mar 2025 00:03:32 +0100 Subject: [PATCH 04/27] -- --- .github/actions/generate/action.yml | 5 +++++ .github/workflows/pypi-test.yml | 5 +++++ .github/workflows/release.yml | 15 +++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml index 3a7d4ce..0327bc0 100644 --- a/.github/actions/generate/action.yml +++ b/.github/actions/generate/action.yml @@ -46,6 +46,11 @@ runs: restore-keys: | poetry-${{ runner.os }}- + - name: 📦 Install poetry + uses: abatilo/actions-poetry@v4 + with: + poetry-version: '2.1.1' + - name: Install avro-to-python-etp run: | poetry add -D avro-to-python-etp diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 51136f5..1d6786a 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -45,6 +45,11 @@ jobs: restore-keys: | poetry-${{ runner.os }}- + - name: 📦 Install poetry + uses: abatilo/actions-poetry@v4 + with: + poetry-version: '2.1.1' + - name: Python Black run: | cd ${{ env.GENERATED_CODE_FOLDER }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce5ee98..06b0563 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,11 +30,18 @@ jobs: dest-folder: ${{ env.GENERATED_CODE_FOLDER }} etp-file-name: ${{ secrets.ETP_FILE_NAME }} - - name: Install dependencies - uses: ./.github/actions/prepare-poetry + - name: 💾 Cache Poetry dependencies + uses: actions/cache@v3 with: - python-version: ${{ env.PYTHON_VERSION }} - toml-path: ${{ env.GENERATED_CODE_FOLDER }} + path: ~/.cache/pypoetry + key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + restore-keys: | + poetry-${{ runner.os }}- + + - name: 📦 Install poetry + uses: abatilo/actions-poetry@v4 + with: + poetry-version: '2.1.1' - name: Python Black run: | From a1fba496afbb9d45dbc5087d67b018014544eb0c Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Fri, 28 Mar 2025 00:07:09 +0100 Subject: [PATCH 05/27] -- --- .github/workflows/ci-test.yml | 2 +- .github/workflows/pypi-test.yml | 1 + .github/workflows/release.yml | 11 ++++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 70b7a8b..492f146 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -40,7 +40,7 @@ jobs: - name: Run pytest run: | cd ${{ env.GENERATED_CODE_FOLDER }} - poetry add pytest + poetry add -D pytest poetry run pytest --cov=etptypes --cov-report=xml --junitxml=pytest.xml shell: bash diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 1d6786a..0f6b7ec 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -53,6 +53,7 @@ jobs: - name: Python Black run: | cd ${{ env.GENERATED_CODE_FOLDER }} + poetry add -D black poetry run black etptypes - name: 📦 Install poetry-dynamic-versioning diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06b0563..f0f4939 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,11 @@ jobs: dest-folder: ${{ env.GENERATED_CODE_FOLDER }} etp-file-name: ${{ secrets.ETP_FILE_NAME }} + - name: 🐍 Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: 💾 Cache Poetry dependencies uses: actions/cache@v3 with: @@ -46,6 +51,7 @@ jobs: - name: Python Black run: | cd ${{ env.GENERATED_CODE_FOLDER }} + poetry add -D black poetry run black etptypes - name: 📦 Install poetry-dynamic-versioning @@ -54,11 +60,6 @@ jobs: - name: 📥 Install dependencies run: poetry install --no-interaction --no-root - - name: Configure Poetry with PyPI repository and token - run: | - poetry config repositories.test-pypi https://test.pypi.org/legacy/ - poetry config pypi-token.test-pypi ${{ secrets.POETRY_PYPI_TEST_TOKEN_VALUE }} - - name: 🛠️ Build the package run: | cd ${{ env.GENERATED_CODE_FOLDER }} From 7a57bba9e0731c7d70ddc0484731293703d5ab47 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 10:50:15 +0200 Subject: [PATCH 06/27] -- --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f5e74fa..c9e8178 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ dist/ output/ dist/ -tmp/ \ No newline at end of file +tmp/ +*.txt \ No newline at end of file From 1e8d9939918c9e7d9d58a552f17fc2d4fcf5c97d Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 10:58:50 +0200 Subject: [PATCH 07/27] ci --- .github/workflows/pypi-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 0f6b7ec..7bb9eaa 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -74,6 +74,10 @@ jobs: cp ${{ github.workspace }}/pyproject.toml . cp ${{ github.workspace }}/LICENSE . cp ${{ github.workspace }}/README.md . + if [ ! -f pyproject.toml ]; then echo "pyproject.toml not found"; exit 1; fi + if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi + if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi + poetry version poetry build - name: 🚀 Publish to PyPI From e15416e12362cec44de6459994b5316c9b16dde1 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:11:59 +0200 Subject: [PATCH 08/27] ci --- .github/workflows/pypi-test.yml | 3 +++ .github/workflows/release.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 7bb9eaa..4238d80 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -79,8 +79,11 @@ jobs: if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version poetry build + ls dist/ - name: 🚀 Publish to PyPI run: | + pwd cd ${{ env.GENERATED_CODE_FOLDER }} + pwd poetry publish --repository test-pypi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0f4939..a5133a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,5 +71,6 @@ jobs: - name: 🚀 Publish to PyPI run: | + cd ${{ env.GENERATED_CODE_FOLDER }} poetry config pypi-token.pypi ${{ secrets.POETRY_PYPI_TOKEN_PASSWORD }} poetry publish \ No newline at end of file From ca0bd9b0111ead29489aa94aa5cb3126ea893c66 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:14:30 +0200 Subject: [PATCH 09/27] ci --- .github/workflows/pypi-test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 4238d80..3adad12 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -79,11 +79,10 @@ jobs: if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version poetry build - ls dist/ - name: 🚀 Publish to PyPI run: | - pwd + ls . cd ${{ env.GENERATED_CODE_FOLDER }} - pwd + ls . poetry publish --repository test-pypi From 0f193dd87f59bf6d8cfe3b7302155771e1d044a3 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:19:02 +0200 Subject: [PATCH 10/27] ci --- .github/workflows/pypi-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 3adad12..26536ae 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -82,7 +82,6 @@ jobs: - name: 🚀 Publish to PyPI run: | - ls . cd ${{ env.GENERATED_CODE_FOLDER }} - ls . + ls dist poetry publish --repository test-pypi From f4a49d5a25f08b13654deb156bc6df9a5e3eb3e0 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:27:09 +0200 Subject: [PATCH 11/27] ci --- .github/workflows/pypi-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 26536ae..9f2cbd7 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -78,10 +78,9 @@ jobs: if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version - poetry build - name: 🚀 Publish to PyPI run: | cd ${{ env.GENERATED_CODE_FOLDER }} ls dist - poetry publish --repository test-pypi + poetry publish --repository test-pypi --build From 6f04af24c84979c809a554e83fbc1ca8ac40b52c Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:28:20 +0200 Subject: [PATCH 12/27] -- --- .github/workflows/pypi-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 9f2cbd7..45c2c38 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -78,6 +78,7 @@ jobs: if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version + poetry build - name: 🚀 Publish to PyPI run: | From 368dc5164359442bc80867caf0bcefad54523662 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:33:25 +0200 Subject: [PATCH 13/27] ci --- .github/workflows/pypi-test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 45c2c38..6e3f42d 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -70,6 +70,7 @@ jobs: - name: 🛠️ Build the package run: | cd ${{ env.GENERATED_CODE_FOLDER }} + rm -rf dist rm pyproject.toml cp ${{ github.workspace }}/pyproject.toml . cp ${{ github.workspace }}/LICENSE . @@ -80,8 +81,16 @@ jobs: poetry version poetry build + - name: Debug Publish Step + run: | + cd ${{ env.GENERATED_CODE_FOLDER }} + pwd + ls dist + poetry version + poetry config --list + - name: 🚀 Publish to PyPI run: | cd ${{ env.GENERATED_CODE_FOLDER }} ls dist - poetry publish --repository test-pypi --build + poetry publish --repository test-pypi From c506648b17178a3cbcf41469be019179d4e62f8a Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:40:45 +0200 Subject: [PATCH 14/27] ci --- pyproject.toml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d793757..fcba079 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,9 +40,15 @@ python = "^3.9, <4.0" pydantic = "<2.0.0" typingx = "^0.6.0" +# [build-system] +# requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +# build-backend = "poetry_dynamic_versioning.backend" [build-system] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] -build-backend = "poetry_dynamic_versioning.backend" +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry.plugins."poetry.plugin"] +"dynamic-versioning" = "poetry_dynamic_versioning.plugin" [tool.poetry-dynamic-versioning] enable = true From c4e2dfd613f83f41c99acbdef3df1dcf447d4552 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 11:41:57 +0200 Subject: [PATCH 15/27] ci --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fcba079..cacf948 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,12 +40,12 @@ python = "^3.9, <4.0" pydantic = "<2.0.0" typingx = "^0.6.0" -# [build-system] -# requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] -# build-backend = "poetry_dynamic_versioning.backend" [build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +build-backend = "poetry_dynamic_versioning.backend" +# [build-system] +# requires = ["poetry-core>=1.0.0"] +# build-backend = "poetry.core.masonry.api" [tool.poetry.plugins."poetry.plugin"] "dynamic-versioning" = "poetry_dynamic_versioning.plugin" From 4504e8a88f34c32cd6976969747260da4fbe4654 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 13:56:25 +0200 Subject: [PATCH 16/27] -- --- .github/workflows/pypi-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 6e3f42d..cbd6cba 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -93,4 +93,5 @@ jobs: run: | cd ${{ env.GENERATED_CODE_FOLDER }} ls dist + poetry version poetry publish --repository test-pypi From 308857c81a6dd24d19161b5cdc48d7d17f780691 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 13:59:26 +0200 Subject: [PATCH 17/27] ci --- .github/workflows/pypi-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index cbd6cba..7ad5660 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -79,7 +79,7 @@ jobs: if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version - poetry build + # poetry build - name: Debug Publish Step run: | @@ -94,4 +94,4 @@ jobs: cd ${{ env.GENERATED_CODE_FOLDER }} ls dist poetry version - poetry publish --repository test-pypi + poetry publish --repository test-pypi --build From baec4085a5a5587650b7b4847b2e816e16a48806 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:03:43 +0200 Subject: [PATCH 18/27] ci --- .github/workflows/pypi-test.yml | 6 +++--- pyproject.toml | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 7ad5660..f28121e 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -79,7 +79,7 @@ jobs: if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version - # poetry build + poetry build - name: Debug Publish Step run: | @@ -93,5 +93,5 @@ jobs: run: | cd ${{ env.GENERATED_CODE_FOLDER }} ls dist - poetry version - poetry publish --repository test-pypi --build + # poetry version + poetry publish --repository test-pypi diff --git a/pyproject.toml b/pyproject.toml index cacf948..73c59d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,9 @@ build-backend = "poetry_dynamic_versioning.backend" [tool.poetry.plugins."poetry.plugin"] "dynamic-versioning" = "poetry_dynamic_versioning.plugin" +[tool.dunamai] +version_strategy = "post-release" + [tool.poetry-dynamic-versioning] enable = true vcs = "git" From 820c140ed24fa74f5eccc15331d53c9f2da354ed Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:18:36 +0200 Subject: [PATCH 19/27] ci --- pyproject.toml | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 73c59d1..0a03977 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,53 +1,39 @@ -[tool.poetry] +[project] name = "etptypes" -version = "0.0.0" +dynamic = [ "version", "dependencies" ] description = "ETP python dev kit" authors = [ - "Lionel Untereiner ", - "Valentin Gauthier " + {name = "Lionel Untereiner", email = "lionel.untereiner@geosiris.com"} , + {name = "Valentin Gauthier", email = "valentin.gauthier@geosiris.com"} +] +maintainers = [ + {name = "Valentin Gauthier", email = "valentin.gauthier@geosiris.com"} ] license = "Apache-2.0" readme = "README.md" repository = "https://github.com/geosiris-technologies/etptypes-python" homepage = "http://www.geosiris.com" -classifiers = [ - "Intended Audience :: Information Technology", - "Intended Audience :: System Administrators", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Programming Language :: Python", - "Topic :: Internet", - "Topic :: Software Development :: Libraries :: Application Frameworks", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development", - "Typing :: Typed", - "Development Status :: 4 - Beta", - "Environment :: Web Environment", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Topic :: Internet :: WWW/HTTP", -] keywords = ["ETP"] +requires-python = ">=3.9, <4.0" + +[tool.poetry] +version = "0.0.0" [tool.poetry.dependencies] -python = "^3.9, <4.0" pydantic = "<2.0.0" typingx = "^0.6.0" +[tool.poetry.group.dev.dependencies] +avro-to-python-etp = "^1.0.11" + [build-system] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] +requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.1"] build-backend = "poetry_dynamic_versioning.backend" # [build-system] # requires = ["poetry-core>=1.0.0"] # build-backend = "poetry.core.masonry.api" -[tool.poetry.plugins."poetry.plugin"] +[project.entry-points."poetry.plugin"] "dynamic-versioning" = "poetry_dynamic_versioning.plugin" [tool.dunamai] From 093f2e4ac99b84ed4afde5783845a68fa6eb43f2 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:22:27 +0200 Subject: [PATCH 20/27] ci --- .github/actions/generate/action.yml | 2 +- pyproject.toml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml index 0327bc0..490085d 100644 --- a/.github/actions/generate/action.yml +++ b/.github/actions/generate/action.yml @@ -53,7 +53,7 @@ runs: - name: Install avro-to-python-etp run: | - poetry add -D avro-to-python-etp + poetry self add avro-to-python-etp shell: bash - name: Translate avpr to avsc diff --git a/pyproject.toml b/pyproject.toml index 0a03977..fdbca1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,9 +23,6 @@ version = "0.0.0" pydantic = "<2.0.0" typingx = "^0.6.0" -[tool.poetry.group.dev.dependencies] -avro-to-python-etp = "^1.0.11" - [build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.1"] build-backend = "poetry_dynamic_versioning.backend" From 88617a547484e523777ba9398475ea778a0bd30b Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:29:27 +0200 Subject: [PATCH 21/27] ci --- .github/actions/generate/action.yml | 11 ++++++----- .github/workflows/ci-test.yml | 3 ++- pyproject.toml | 7 +++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml index 490085d..e5beda5 100644 --- a/.github/actions/generate/action.yml +++ b/.github/actions/generate/action.yml @@ -38,6 +38,11 @@ runs: with: python-version: ${{ inputs.python-version }} + - name: 📦 Install poetry + uses: abatilo/actions-poetry@v4 + with: + poetry-version: '2.1.1' + - name: 💾 Cache Poetry dependencies uses: actions/cache@v3 with: @@ -46,14 +51,10 @@ runs: restore-keys: | poetry-${{ runner.os }}- - - name: 📦 Install poetry - uses: abatilo/actions-poetry@v4 - with: - poetry-version: '2.1.1' - - name: Install avro-to-python-etp run: | poetry self add avro-to-python-etp + poetry install --no-interaction --no-root shell: bash - name: Translate avpr to avsc diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 492f146..d3c981d 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -5,7 +5,8 @@ name: Tests on: - pull_request: + workflow_dispatch: + env: GENERATED_CODE_FOLDER: etptypes diff --git a/pyproject.toml b/pyproject.toml index fdbca1c..c2cc997 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,9 @@ version = "0.0.0" pydantic = "<2.0.0" typingx = "^0.6.0" +[tool.poetry.group.dev.dependencies] +avro-to-python-etp = "^1.0.11" + [build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.1"] build-backend = "poetry_dynamic_versioning.backend" @@ -30,8 +33,8 @@ build-backend = "poetry_dynamic_versioning.backend" # requires = ["poetry-core>=1.0.0"] # build-backend = "poetry.core.masonry.api" -[project.entry-points."poetry.plugin"] -"dynamic-versioning" = "poetry_dynamic_versioning.plugin" +# [project.entry-points."poetry.plugin"] +# "dynamic-versioning" = "poetry_dynamic_versioning.plugin" [tool.dunamai] version_strategy = "post-release" From c7b2336ac2efc93e4d3106effde01f74bf82be5d Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:30:54 +0200 Subject: [PATCH 22/27] -- --- .github/workflows/pypi-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index f28121e..dffebef 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -79,7 +79,7 @@ jobs: if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version - poetry build + # poetry build - name: Debug Publish Step run: | @@ -94,4 +94,4 @@ jobs: cd ${{ env.GENERATED_CODE_FOLDER }} ls dist # poetry version - poetry publish --repository test-pypi + poetry publish --repository test-pypi --build From 3ec0be27c9388c352a265acc51f2834485f8c13b Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:31:55 +0200 Subject: [PATCH 23/27] -- --- .github/workflows/pypi-test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index dffebef..447a406 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -81,13 +81,13 @@ jobs: poetry version # poetry build - - name: Debug Publish Step - run: | - cd ${{ env.GENERATED_CODE_FOLDER }} - pwd - ls dist - poetry version - poetry config --list + # - name: Debug Publish Step + # run: | + # cd ${{ env.GENERATED_CODE_FOLDER }} + # pwd + # ls dist + # poetry version + # poetry config --list - name: 🚀 Publish to PyPI run: | From b33296aa953df0df662567c83ffb866b340457c6 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:37:55 +0200 Subject: [PATCH 24/27] version --- .github/workflows/pypi-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 447a406..46c2d74 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -78,7 +78,7 @@ jobs: if [ ! -f pyproject.toml ]; then echo "pyproject.toml not found"; exit 1; fi if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi - poetry version + poetry version $(poetry version | awk '{print $2}') # poetry build # - name: Debug Publish Step From 81db56250f376a0e4f3326913596d76fdfd236e1 Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:38:48 +0200 Subject: [PATCH 25/27] -- --- .github/workflows/pypi-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 46c2d74..dce56be 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -92,6 +92,5 @@ jobs: - name: 🚀 Publish to PyPI run: | cd ${{ env.GENERATED_CODE_FOLDER }} - ls dist # poetry version poetry publish --repository test-pypi --build From c5f3917ad3e3e25e6a3d09c088a826a457113b6f Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:40:29 +0200 Subject: [PATCH 26/27] -- --- .github/workflows/pypi-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index dce56be..5ba09b6 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -93,4 +93,4 @@ jobs: run: | cd ${{ env.GENERATED_CODE_FOLDER }} # poetry version - poetry publish --repository test-pypi --build + poetry publish --build --repository test-pypi From 0b8f6d3141e4720993798031ae63afc84de6963c Mon Sep 17 00:00:00 2001 From: Valentin Gauthier Date: Tue, 8 Apr 2025 14:54:32 +0200 Subject: [PATCH 27/27] dyn vers --- .github/workflows/pypi-test.yml | 7 ++++--- .github/workflows/release.yml | 2 +- pyproject.toml | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pypi-test.yml b/.github/workflows/pypi-test.yml index 5ba09b6..73670be 100644 --- a/.github/workflows/pypi-test.yml +++ b/.github/workflows/pypi-test.yml @@ -57,7 +57,7 @@ jobs: poetry run black etptypes - name: 📦 Install poetry-dynamic-versioning - run: poetry add -D poetry-dynamic-versioning[plugin] + run: poetry self add "poetry-dynamic-versioning[plugin]" - name: 📥 Install dependencies run: poetry install --no-interaction --no-root @@ -79,7 +79,7 @@ jobs: if [ ! -f LICENSE ]; then echo "LICENSE not found"; exit 1; fi if [ ! -f README.md ]; then echo "README.md not found"; exit 1; fi poetry version $(poetry version | awk '{print $2}') - # poetry build + poetry build # - name: Debug Publish Step # run: | @@ -93,4 +93,5 @@ jobs: run: | cd ${{ env.GENERATED_CODE_FOLDER }} # poetry version - poetry publish --build --repository test-pypi + # poetry publish --build --repository test-pypi + poetry publish --repository test-pypi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5133a3..e2c43ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,7 +55,7 @@ jobs: poetry run black etptypes - name: 📦 Install poetry-dynamic-versioning - run: poetry add -D poetry-dynamic-versioning[plugin] + run: poetry self add "poetry-dynamic-versioning[plugin]" - name: 📥 Install dependencies run: poetry install --no-interaction --no-root diff --git a/pyproject.toml b/pyproject.toml index c2cc997..cb61a6e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ typingx = "^0.6.0" [tool.poetry.group.dev.dependencies] avro-to-python-etp = "^1.0.11" +poetry-dynamic-versioning = {extras = ["plugin"], version = "^1.8.2"} [build-system] requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.1"] @@ -33,8 +34,8 @@ build-backend = "poetry_dynamic_versioning.backend" # requires = ["poetry-core>=1.0.0"] # build-backend = "poetry.core.masonry.api" -# [project.entry-points."poetry.plugin"] -# "dynamic-versioning" = "poetry_dynamic_versioning.plugin" +[project.entry-points."poetry.plugin"] +"dynamic-versioning" = "poetry_dynamic_versioning.plugin" [tool.dunamai] version_strategy = "post-release"