diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b71e1f3..4d78b8f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,34 +1,34 @@ name: Release to PyPI on: - push: - tags: - - '*' + push: + tags: + - '*' jobs: - release: - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/project/pyscript - permissions: - id-token: write - steps: - - name: Checkout code - uses: actions/checkout@v2 + release: + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/pyscript + permissions: + id-token: write + steps: + - name: Checkout code + uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.11 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.11 - - name: Install dependencies - run: pip install -r requirements.txt + - name: Install dependencies + run: pip install -r requirements.txt - - name: Build and package - run: | - pip install wheel - python setup.py sdist bdist_wheel + - name: Build and package + run: | + pip install wheel + python setup.py sdist bdist_wheel - - name: Upload to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + - name: Upload to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/setup.py b/setup.py index 4e0339f..212a190 100644 --- a/setup.py +++ b/setup.py @@ -1,18 +1,23 @@ import os + from setuptools import setup + def read_version(): - with open("src/pyscript/version", "r") as f: + with open("src/pyscript/version") as f: return f.read().strip("\n") + def check_tag_version(): tag = os.getenv("GITHUB_REF") expected_version = read_version() if tag != f"refs/tags/{expected_version}": - raise Exception(f"Tag '{tag}' does not match the expected " - f"version '{expected_version}'") + raise Exception( + f"Tag '{tag}' does not match the expected " f"version '{expected_version}'" + ) -with open("README.md", "r") as fh: + +with open("README.md") as fh: long_description = fh.read() check_tag_version() @@ -29,27 +34,27 @@ def check_tag_version(): license="Apache-2.0", install_requires=[ 'importlib-metadata; python_version<"3.8"', - 'Jinja2<3.2', - 'pluggy<1.3', - 'rich<=13.7.1', - 'toml<0.11', - 'typer<=0.9.0', - 'platformdirs<4.3', - 'requests<=2.31.0', + "Jinja2<3.2", + "pluggy<1.3", + "rich<=13.7.1", + "toml<0.11", + "typer<=0.9.0", + "platformdirs<4.3", + "requests<=2.31.0", ], python_requires=">=3.9", keywords=["pyscript", "cli", "pyodide", "micropython", "pyscript-cli"], classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Console', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Topic :: Software Development :: Code Generators', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Software Development :: Pre-processors', + "Development Status :: 4 - Beta", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Topic :: Software Development :: Code Generators", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Software Development :: Pre-processors", ], extras_require={ "dev": [ @@ -57,25 +62,25 @@ def check_tag_version(): "mypy<=1.4.1", "pytest<7.5", "types-toml<0.11", - "types-requests" + "types-requests", ], "docs": [ "Sphinx<5.2", "sphinx-autobuild<2021.4.0", "sphinx-autodoc-typehints<1.20", "myst-parser<0.19.3", - "pydata-sphinx-theme<0.13.4" - ] + "pydata-sphinx-theme<0.13.4", + ], }, entry_points={ - 'console_scripts': [ - 'pyscript = pyscript.cli:app', + "console_scripts": [ + "pyscript = pyscript.cli:app", ], }, project_urls={ - 'Documentation': 'https://docs.pyscript.net', - 'Examples': 'https://pyscript.com/@examples', - 'Homepage': 'https://pyscript.net', - 'Repository': 'https://github.com/pyscript/pyscript-cli', + "Documentation": "https://docs.pyscript.net", + "Examples": "https://pyscript.com/@examples", + "Homepage": "https://pyscript.net", + "Repository": "https://github.com/pyscript/pyscript-cli", }, )