From 8aef0317a0e86073ebbe38498e3bcc06cde94acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 20 Feb 2024 12:48:26 +0100 Subject: [PATCH 1/5] :bug: fix version check --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 617dac8..88681ab 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os import sys -if sys.version_info < (3, 4): +if sys.version_info > (3, 4): import importlib as imp else: import imp From 3ae76a42d671e67c9121f48760138b9bf34dd896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 20 Feb 2024 14:16:01 +0100 Subject: [PATCH 2/5] :bug: fix build --- .github/workflows/pythonpublish.yml | 6 +++--- setup.py | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 21f2f01..8714700 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -8,11 +8,11 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5py with: - python-version: '3.x' + python-version: '3.9' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/setup.py b/setup.py index 88681ab..a21e786 100644 --- a/setup.py +++ b/setup.py @@ -4,11 +4,6 @@ import os import sys -if sys.version_info > (3, 4): - import importlib as imp -else: - import imp - from io import open @@ -17,7 +12,13 @@ long_description = f.read() version_file = os.path.abspath("speedcopy/version.py") -version_mod = imp.load_source("version", version_file) + +if sys.version_info > (3, 4): + from importlib.machinery import SourceFileLoader + version_mod = SourceFileLoader("version", version_file).load_module() +else: + import imp + version_mod = imp.load_source("version", version_file) version = version_mod.version classifiers = [ From 9300b946a4e27ae0e7ca22c41d5a0fbde45ffdab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 20 Feb 2024 14:19:20 +0100 Subject: [PATCH 3/5] :bug: fix workflow --- .github/workflows/pythonpublish.yml | 2 +- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 8714700..3f00523 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v5py + uses: actions/setup-python@v5 with: python-version: '3.9' - name: Install dependencies diff --git a/pyproject.toml b/pyproject.toml index 263f884..5e88a53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,9 @@ [tool.poetry] name = "speedcopy" version = "2.1.5" -description = "" +description = "Replacement or alternative for python copyfile() utilizing server side copy on network shares for faster copying." authors = ["Ondrej Samohel "] +license = "MIT License" [tool.poetry.dependencies] python = ">=2.7" From 4dcb15f6698c922fbf8994cc7eafaec6d2a7bfca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 20 Feb 2024 14:34:20 +0100 Subject: [PATCH 4/5] :package: change trusted publisher for pypi --- .github/workflows/pythonpublish.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 3f00523..b0396a4 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -5,22 +5,19 @@ on: types: [created] jobs: - deploy: + pypi-publish: + name: Publish to PyPI runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/project/${{ github.repository }} + permissions: + id-token: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.9' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + uses: pypa/gh-action-pypi-publish@release/v1 From ca67b27583adf97cb66fe86f82454b2bea7d8c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Samohel?= Date: Tue, 20 Feb 2024 14:40:24 +0100 Subject: [PATCH 5/5] :package: add back bdist_wheel --- .github/workflows/pythonpublish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index b0396a4..126954c 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -19,5 +19,10 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.9' + - name: Install dependencies and build + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + python setup.py sdist bdist_wheel - name: Build and publish uses: pypa/gh-action-pypi-publish@release/v1