diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index 21f2f01..126954c 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -5,22 +5,24 @@ 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@v1 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: - python-version: '3.x' - - name: Install dependencies + python-version: '3.9' + - name: Install dependencies and build 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: | + pip install setuptools wheel python setup.py sdist bdist_wheel - twine upload dist/* + - name: Build and publish + uses: pypa/gh-action-pypi-publish@release/v1 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" diff --git a/setup.py b/setup.py index 617dac8..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 = [