From 170135279ad59d89db6e910aabaf562c492ffb9d Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 05:18:10 -0700 Subject: [PATCH 01/14] fix version flag --- .github/workflows/prerelease.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 92a429b..1b87eeb 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,6 +1,9 @@ name: Pre-release TypedUnits on: + pull_request: + branches: + - main push: branches: - main From cc6ce1e61c1f5ecac6dd8404a4df422c6b0108b4 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 05:23:03 -0700 Subject: [PATCH 02/14] export --- .github/workflows/prerelease.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 1b87eeb..1040edb 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -31,9 +31,9 @@ jobs: pip install build auditwheel patchelf - name: Build package - env: - TypedUnits_RELEASE_VERSION: ${{ "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" }} - run: python -m build + run: | + export TypedUnits_RELEASE_VERSION="$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" + python -m build - name: Repair Wheel run: | From 5871b8036422c856996c39c7d57a7f94cb4474d0 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 05:32:14 -0700 Subject: [PATCH 03/14] add desc --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index c4265d2..80f7cba 100644 --- a/setup.py +++ b/setup.py @@ -49,4 +49,5 @@ install_requires=requirements, setup_requires=requirements, python_requires=">=3.10.0", + long_description='A cython based units library with protobuffers support and a notion of dimensions.', ) From 0ce20a3b58feb861f4f9c3f0ffc436f8b3c87545 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:06:40 -0700 Subject: [PATCH 04/14] add env --- .github/workflows/prerelease.yml | 4 ++++ setup.py | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 1040edb..9537196 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -19,6 +19,10 @@ jobs: matrix: python-version: ["3.10", "3.11", "3.12"] + environment: + name: testpypi + url: https://test.pypi.org/p/typedunits + steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/setup.py b/setup.py index 80f7cba..0e66a10 100644 --- a/setup.py +++ b/setup.py @@ -50,4 +50,5 @@ setup_requires=requirements, python_requires=">=3.10.0", long_description='A cython based units library with protobuffers support and a notion of dimensions.', + long_description_content_type='text/x-rst', ) From 7c1e2348f070c952fe30157652bb61b80351d68b Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:10:45 -0700 Subject: [PATCH 05/14] rerun ci --- .github/workflows/prerelease.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 9537196..ae015b4 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -19,10 +19,6 @@ jobs: matrix: python-version: ["3.10", "3.11", "3.12"] - environment: - name: testpypi - url: https://test.pypi.org/p/typedunits - steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -47,6 +43,6 @@ jobs: - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: - repository-url: https://test.pypi.org/legacy/ + repository_url: https://test.pypi.org/legacy/ user: __token__ password: ${{ secrets.TEST_PYPI_API_TOKEN }} \ No newline at end of file From 8534c50285610fa305027909c07afc42a4182d08 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:20:35 -0700 Subject: [PATCH 06/14] canonize version --- .github/workflows/prerelease.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index ae015b4..3255dab 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -12,6 +12,15 @@ permissions: contents: read jobs: + create_version: + - uses: actions/checkout@v1 + - run: | + echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt + - uses: actions/upload-artifact@master + with: + name: version-file + path: version.txt + deploy: runs-on: ubuntu-latest @@ -30,9 +39,14 @@ jobs: python -m pip install --upgrade pip pip install build auditwheel patchelf + - uses: actions/download-artifact@master + with: + name: version-file + path: version.txt + - name: Build package run: | - export TypedUnits_RELEASE_VERSION="$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" + export TypedUnits_RELEASE_VERSION="$(cat version.txt)" python -m build - name: Repair Wheel From 3537367d3e01f24bc9de27e65c01cc394497d989 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:23:03 -0700 Subject: [PATCH 07/14] fix --- .github/workflows/prerelease.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3255dab..9a706bd 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -13,13 +13,14 @@ permissions: jobs: create_version: - - uses: actions/checkout@v1 - - run: | - echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt - - uses: actions/upload-artifact@master - with: - name: version-file - path: version.txt + steps: + - uses: actions/checkout@v4 + - run: | + echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt + - uses: actions/upload-artifact@master + with: + name: version-file + path: version.txt deploy: From bf1da8495def73d250500dc34ea6fe8769474450 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:23:51 -0700 Subject: [PATCH 08/14] fix --- .github/workflows/prerelease.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 9a706bd..cad1d79 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - run: | - echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt + echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt - uses: actions/upload-artifact@master with: name: version-file From 03252dea247ebde91a3c9794a15ec5d3c646ce01 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:28:38 -0700 Subject: [PATCH 09/14] fix --- .github/workflows/prerelease.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index cad1d79..3ecbe70 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -13,9 +13,14 @@ permissions: jobs: create_version: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: | + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Create version + run: | echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt - uses: actions/upload-artifact@master with: From 2acf934b317a41261df766ce9fde8bacff5a7e07 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:43:04 -0700 Subject: [PATCH 10/14] remove tar --- .github/workflows/prerelease.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 3ecbe70..9c499eb 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -22,6 +22,7 @@ jobs: - name: Create version run: | echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt + cat version.txt - uses: actions/upload-artifact@master with: name: version-file @@ -52,7 +53,9 @@ jobs: - name: Build package run: | + cat version.txt export TypedUnits_RELEASE_VERSION="$(cat version.txt)" + echo $TypedUnits_RELEASE_VERSION python -m build - name: Repair Wheel @@ -60,6 +63,8 @@ jobs: auditwheel repair --plat manylinux2014_x86_64 dist/*.whl rm dist/*.whl mv wheelhouse/* dist/ + rm dist/*.tar.gz + - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: From 6af987f73ef09f7b98469e85dc27ca907e3fc114 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:46:31 -0700 Subject: [PATCH 11/14] nit --- .github/workflows/prerelease.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 9c499eb..c7de1e0 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -21,12 +21,13 @@ jobs: python-version: '3.10' - name: Create version run: | - echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version.txt - cat version.txt + mkdir version + echo "$(python _version.py).dev$(date '+%Y%m%d%H%M%S')" > version/version.txt + cat version/version.txt - uses: actions/upload-artifact@master with: name: version-file - path: version.txt + path: version deploy: @@ -49,12 +50,12 @@ jobs: - uses: actions/download-artifact@master with: name: version-file - path: version.txt + path: version - name: Build package run: | - cat version.txt - export TypedUnits_RELEASE_VERSION="$(cat version.txt)" + cat version/version.txt + export TypedUnits_RELEASE_VERSION="$(cat version/version.txt)" echo $TypedUnits_RELEASE_VERSION python -m build From 8dd08671ecab8ad917e7b58bd04467c671f84919 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:49:36 -0700 Subject: [PATCH 12/14] clean up --- .github/workflows/prerelease.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index c7de1e0..72717a8 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,9 +1,6 @@ name: Pre-release TypedUnits on: - pull_request: - branches: - - main push: branches: - main @@ -54,9 +51,7 @@ jobs: - name: Build package run: | - cat version/version.txt export TypedUnits_RELEASE_VERSION="$(cat version/version.txt)" - echo $TypedUnits_RELEASE_VERSION python -m build - name: Repair Wheel From b7b66c0d700000376d21f26957e49203822f9b8c Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:51:58 -0700 Subject: [PATCH 13/14] update desc --- .github/workflows/prerelease.yml | 3 +++ setup.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 72717a8..ae8d478 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,6 +1,9 @@ name: Pre-release TypedUnits on: + pull_request: + branches: + - main push: branches: - main diff --git a/setup.py b/setup.py index 0e66a10..e7291f3 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,6 @@ install_requires=requirements, setup_requires=requirements, python_requires=">=3.10.0", - long_description='A cython based units library with protobuffers support and a notion of dimensions.', - long_description_content_type='text/x-rst', + long_description=open("README.md", encoding="utf-8").read(), + long_description_content_type='text/markdown', ) From dd2b2d9b1ac4ad6902eaae48f029b6abb194a2b3 Mon Sep 17 00:00:00 2001 From: Nour Yosri Date: Wed, 11 Sep 2024 07:54:20 -0700 Subject: [PATCH 14/14] cleanup --- .github/workflows/prerelease.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index ae8d478..72717a8 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -1,9 +1,6 @@ name: Pre-release TypedUnits on: - pull_request: - branches: - - main push: branches: - main