From a8a44c398fa65aaea04c73ab7ecec6d66f91de19 Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Thu, 6 Jun 2024 09:33:54 +0200 Subject: [PATCH 1/4] add box to requirements, add relese_text.md file --- pyproject.toml | 2 +- release_text.md | 0 requirements-dev.lock | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 release_text.md diff --git a/pyproject.toml b/pyproject.toml index 00b6dda..f2351dc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,10 +45,10 @@ dev-dependencies = [ "pytest-cov>=4.1.0", "requests>=2.31.0", "rttools @ git+https://github.com/trappitsch/rttools", + "box-packager>=0.2.0", ] [tool.rye.scripts] -test = "pytest" test_cov = "pytest --cov --cov-report xml" [tool.hatch.metadata] diff --git a/release_text.md b/release_text.md new file mode 100644 index 0000000..e69de29 diff --git a/requirements-dev.lock b/requirements-dev.lock index 1a9e2b9..0cdec88 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -13,14 +13,18 @@ attrs==23.2.0 # via hypothesis babel==2.15.0 # via mkdocs-material +box-packager==0.2.0 certifi==2024.2.2 # via requests charset-normalizer==3.3.2 # via requests click==8.1.7 + # via box-packager # via mkdocs # via mkdocstrings + # via rich-click colorama==0.4.6 + # via box-packager # via griffe # via mkdocs-material contourpy==1.2.1 @@ -54,6 +58,8 @@ markdown==3.6 # via mkdocs-material # via mkdocstrings # via pymdown-extensions +markdown-it-py==3.0.0 + # via rich markupsafe==2.1.5 # via jinja2 # via mkdocs @@ -62,6 +68,8 @@ markupsafe==2.1.5 matplotlib==3.9.0 # via rimsschemedrawer # via rttools +mdurl==0.1.2 + # via markdown-it-py mergedeep==1.3.4 # via mkdocs # via mkdocs-get-deps @@ -116,6 +124,7 @@ pyarrow==16.1.0 # via rttools pygments==2.18.0 # via mkdocs-material + # via rich pymdown-extensions==10.8.1 # via mkdocs-material # via mkdocstrings @@ -149,6 +158,11 @@ regex==2024.5.15 # via mkdocs-material requests==2.32.2 # via mkdocs-material +rich==13.7.1 + # via box-packager + # via rich-click +rich-click==1.8.2 + # via box-packager rttools @ git+https://github.com/trappitsch/rttools@b01d4af6f767190a22e22a953e9d4ce18c7b5d9f scipy==1.13.1 # via rttools @@ -156,8 +170,11 @@ six==1.16.0 # via python-dateutil sortedcontainers==2.4.0 # via hypothesis +tomlkit==0.12.5 + # via box-packager typing-extensions==4.12.0 # via pint + # via rich-click tzdata==2024.1 # via pandas urllib3==2.2.1 From 7c4f478f03caf001e83e838cf98a0fa37ec8c8e5 Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Thu, 6 Jun 2024 09:53:00 +0200 Subject: [PATCH 2/4] add release workflow with commented out pypi part (for testing) --- .github/workflows/release.yml | 78 +++++++++++++++++++++++++++++++---- 1 file changed, 71 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c021a2..bcd1db9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,17 +12,81 @@ env: jobs: build-linux: name: Release on PyPi - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout code uses: actions/checkout@v4 - name: Install the latest version of rye - uses: eifinger/setup-rye@v2 + uses: eifinger/setup-rye@v3 - name: Sync Rye run: | - rye pin ${{ env.PYTHON_VERSION }} - rye sync - - name: Build and release the controller + rye pin ${{ env.PYTHON_VERSION }} --relaxed + rye sync --all-features +# - name: Build and release on PyPi +# run: | +# rye build +# rye publish --token ${{ secrets.PYPI_TOKEN }} --yes + - name: Package Linux App run: | - rye build - rye publish --token ${{ secrets.PYPI_TOKEN }} --yes + rye run box package + mv target/release/rimsschemedrawer target/release/rimsschemedrawer-linux + - name: Release + uses: softprops/action-gh-release@v2 + with: + files: + ${{ github.workspace }}/target/release/rimsschemedrawer-linux + tag_name: ${{ github.ref_name }} + name: RIMSSchemeDrawer ${{ github.ref_name }} + body_path: ${{ github.workspace }}/release_text.md + + build-windows: + needs: build-linux + name: Package GUI for Windows and add to Release + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + - name: Install dependencies + run: | + pip install . + pip install box-packager + pip install build + - name: Package Windows App + run: | + box init -q -b build + rye run box package + mv target/release/rimsschemedrawer.exe target/release/rimsschemedrawer-windows.exe + - name: Add to Release + uses: softprops/action-gh-release@v1 + with: + files: + target/release/rimsschemedrawer-windows.exe + tag_name: ${{ github.ref_name }} + + build-macos: + needs: build-linux + name: Package GUI for MacOS and add to Release + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Rye + uses: eifinger/setup-rye@v3 + - name: Sync Rye + run: | + rye pin ${{ env.PYTHON_VERSION }} --relaxed + rye sync --all-features + - name: Package MacOS App + run: | + rye run box package + mv target/release/rimsschemedrawer target/release/rimsschemedrawer-macos + - name: Add to Release + uses: softprops/action-gh-release@v1 + with: + files: + target/release/rimsschemedrawer-macos + tag_name: ${{ github.ref_name }} From 2014b0a703f7e8e2a81deacb98631395d17dbd44 Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Thu, 6 Jun 2024 09:53:11 +0200 Subject: [PATCH 3/4] bump version to rc1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f2351dc..6a254c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rimsschemedrawer" -version = "3.0.0.dev4" +version = "3.0.0rc1" description = "Drawing of RIMS schemes in python and/or with a Python GUI." authors = [ { name = "Reto Trappitsch", email = "reto@galactic-forensics.space" } From cc8725988ca3d46cfd8c34a0f9aeb8aa2611334c Mon Sep 17 00:00:00 2001 From: Reto Trappitsch Date: Thu, 6 Jun 2024 09:57:27 +0200 Subject: [PATCH 4/4] move testing to actual rye test running --- .github/workflows/package_testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package_testing.yml b/.github/workflows/package_testing.yml index 6db1a21..22ccaf1 100644 --- a/.github/workflows/package_testing.yml +++ b/.github/workflows/package_testing.yml @@ -26,7 +26,7 @@ jobs: rye pin ${{ matrix.python-version }} rye sync - name: Run Tests for python interface - run: rye run test + run: rye test - name: Run Lint on one python if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }} run: rye lint