From 6e6d68389cf32b0ea9a045188335c3cc716af4b5 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 10:46:43 +0100 Subject: [PATCH 01/14] move deps to text file --- requirements.txt | 4 ++++ setup.cfg | 5 ----- setup.py | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2e23c7e --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +pbr +numpy +networkx >= 2.0 +pysmiles @ git+https://github.com/pckroon/pysmiles.git@master diff --git a/setup.cfg b/setup.cfg index 6a725c0..07f98eb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -30,11 +30,6 @@ packages = find: setup-requires = setuptools >= 46.4.0 pbr -install-requires = # ?? requires-dist? - pbr - numpy - networkx >= 2.0 - pysmiles @ git+https://github.com/pckroon/pysmiles.git@master zip-safe = False diff --git a/setup.py b/setup.py index b40a3bc..1eb4a54 100644 --- a/setup.py +++ b/setup.py @@ -2,4 +2,5 @@ setup( pbr=True, + requirements='requirements.txt' ) From 456406600a16c97934720df29052a1285bf003e0 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 10:48:39 +0100 Subject: [PATCH 02/14] add deploy --- .github/workflows/python-app.yml | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e2f4687..59aac11 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -58,3 +58,39 @@ jobs: - name: Run pylint run: | pylint --disable=fixme --fail-under=8.0 cgsmiles + + deploy: + needs: [build, lint] + runs-on: ubuntu-latest + environment: + name: testpypi + url: https://test.pypi.org/p/cgsmiles + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + with: + fetch-tags: true + fetch-depth: 0 + - name: Set up Python 3 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: pip + cache-dependency-path: | + **/setup.cfg + **/requirements*.txt + **/pyproject.toml + - name: Install dependencies + run: | + pip install --upgrade setuptools pip + pip install --upgrade . + - name: Install pypa/build + run: | + python3 -m pip install build pbr --user + - name: Build a binary wheel and a source tarball + run: python3 -m build --sdist --wheel --outdir dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ From dd0ca642c2947987988a601bf916ad7bb92efac1 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 10:53:37 +0100 Subject: [PATCH 03/14] add deploy --- .github/workflows/python-app.yml | 2 +- requirements.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 59aac11..f58c700 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -60,7 +60,7 @@ jobs: pylint --disable=fixme --fail-under=8.0 cgsmiles deploy: - needs: [build, lint] + needs: [lint] runs-on: ubuntu-latest environment: name: testpypi diff --git a/requirements.txt b/requirements.txt index 2e23c7e..4d5412c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ pbr numpy networkx >= 2.0 -pysmiles @ git+https://github.com/pckroon/pysmiles.git@master From f1a274936575d26921b3deff10016e029d14637a Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 10:57:20 +0100 Subject: [PATCH 04/14] add deploy --- .github/workflows/python-app.yml | 54 +++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index f58c700..0958c9d 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -60,37 +60,35 @@ jobs: pylint --disable=fixme --fail-under=8.0 cgsmiles deploy: - needs: [lint] + needs: lint runs-on: ubuntu-latest - environment: - name: testpypi - url: https://test.pypi.org/p/cgsmiles - permissions: - id-token: write + steps: - - uses: actions/checkout@v4 - with: - fetch-tags: true - fetch-depth: 0 - - name: Set up Python 3 - uses: actions/setup-python@v5 + - uses: actions/checkout@master + - name: Set up Python 3.7 + uses: actions/setup-python@v1 with: - python-version: '3.11' - cache: pip - cache-dependency-path: | - **/setup.cfg - **/requirements*.txt - **/pyproject.toml - - name: Install dependencies - run: | - pip install --upgrade setuptools pip - pip install --upgrade . + python-version: 3.7 + - name: Install pypa/build - run: | - python3 -m pip install build pbr --user + run: >- + python -m + pip install + build + --user + pip install pbr + - name: Build a binary wheel and a source tarball - run: python3 -m build --sdist --wheel --outdir dist/ - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@master with: - repository-url: https://test.pypi.org/legacy/ + repository-url: https://test.pypi.org/legacy/ + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} From 14d7609086f187a82286ad5d069b8d98880909e1 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 10:59:07 +0100 Subject: [PATCH 05/14] bump python version --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0958c9d..07a094e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -65,10 +65,10 @@ jobs: steps: - uses: actions/checkout@master - - name: Set up Python 3.7 + - name: Set up Python 3.11 uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: 3.11 - name: Install pypa/build run: >- From 4ed4e8f866fe944bfc45bf8020b0f40de522d180 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:01:09 +0100 Subject: [PATCH 06/14] bump python version --- .github/workflows/python-app.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 07a094e..540777e 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -65,10 +65,10 @@ jobs: steps: - uses: actions/checkout@master - - name: Set up Python 3.11 + - name: Set up Python 3.9 uses: actions/setup-python@v1 with: - python-version: 3.11 + python-version: 3.9 - name: Install pypa/build run: >- From 7e69746403901c638b7badd6caa533ca787a315c Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:06:38 +0100 Subject: [PATCH 07/14] bump python version --- .github/workflows/python-app.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 540777e..e0f7574 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -72,11 +72,8 @@ jobs: - name: Install pypa/build run: >- - python -m - pip install - build - --user - pip install pbr + python -m pip install build + python -m pip install pbr - name: Build a binary wheel and a source tarball run: >- From 9aeccef9d6d3e71c81edc994cf4ee01daffee8d4 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:13:24 +0100 Subject: [PATCH 08/14] bump python version --- .github/workflows/python-app.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e0f7574..5cae271 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -71,9 +71,9 @@ jobs: python-version: 3.9 - name: Install pypa/build - run: >- - python -m pip install build - python -m pip install pbr + run: + pip install build + pip install pbr - name: Build a binary wheel and a source tarball run: >- From 2b86ed7b399661f8e858098a73f3224a587b530c Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:15:23 +0100 Subject: [PATCH 09/14] bump python version --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5cae271..5e1c8de 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -71,7 +71,7 @@ jobs: python-version: 3.9 - name: Install pypa/build - run: + run: | pip install build pip install pbr From 079e1ae285267acd89410950e19529bb6801ff6a Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:18:46 +0100 Subject: [PATCH 10/14] correct token --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 5e1c8de..1bba797 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -88,4 +88,4 @@ jobs: with: repository-url: https://test.pypi.org/legacy/ user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + password: ${{ secrets.PYPI_TEST_API_TOKEN }} From 437ea7c98f63d9e3bedde63a00f494843a47c27d Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:22:24 +0100 Subject: [PATCH 11/14] correct token --- .github/workflows/python-app.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 1bba797..7635576 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -84,8 +84,9 @@ jobs: --outdir dist/ - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: + verbose: true repository-url: https://test.pypi.org/legacy/ user: __token__ password: ${{ secrets.PYPI_TEST_API_TOKEN }} From 5cf9fe8e4515e698e75a53e00ec98ef471f61e55 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:31:31 +0100 Subject: [PATCH 12/14] add version variable --- cgsmiles/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cgsmiles/__init__.py b/cgsmiles/__init__.py index 18eca30..9d11b14 100644 --- a/cgsmiles/__init__.py +++ b/cgsmiles/__init__.py @@ -1,6 +1,8 @@ """ CGsmiles: Coarse-Grained Smiles (CGsmiles) for representing abitrarily complex molecules using line notation. """ +import pbr.version +__version__ = pbr.version.VersionInfo('cgsmiles').release_string() from .read_cgsmiles import read_cgsmiles from .read_fragments import read_fragments From 74b71bb512dad1522d82b21c571e5fd79da1f2b1 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:41:41 +0100 Subject: [PATCH 13/14] add version variable --- setup.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.cfg b/setup.cfg index 07f98eb..37fbac9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,6 +32,12 @@ setup-requires = pbr zip-safe = False +[egg_info] +tag_build = .dev +tag_date = 1 + +[pbr] +version = 0.0.0 #[build_sphinx] #source-dir = doc/source From 61233cbba60e25e9bfcc1c0dabe66195e6442542 Mon Sep 17 00:00:00 2001 From: Fabian Gruenewald Date: Tue, 7 Jan 2025 11:47:58 +0100 Subject: [PATCH 14/14] new requirements --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4d5412c..f85128e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ pbr numpy -networkx >= 2.0 +networkx +pysmiles @ git+https://github.com/pckroon/pysmiles.git@master