|
| 1 | +import os |
| 2 | + |
| 3 | +from setuptools import find_packages, setup |
| 4 | + |
| 5 | + |
| 6 | +def read_version(): |
| 7 | + with open("src/pyscript/version") as f: |
| 8 | + return f.read().strip("\n") |
| 9 | + |
| 10 | + |
| 11 | +def check_tag_version(): |
| 12 | + if os.getenv("CHECK_VERSION", "false").lower() == "true": |
| 13 | + tag = os.getenv("GITHUB_REF") |
| 14 | + expected_version = read_version() |
| 15 | + if tag != f"refs/tags/{expected_version}": |
| 16 | + raise Exception( |
| 17 | + f"Tag '{tag}' does not match the expected " |
| 18 | + f"version '{expected_version}'" |
| 19 | + ) |
| 20 | + |
| 21 | + |
| 22 | +with open("README.md") as fh: |
| 23 | + long_description = fh.read() |
| 24 | + |
| 25 | +check_tag_version() |
| 26 | + |
| 27 | +setup( |
| 28 | + name="pyscript", |
| 29 | + version=read_version(), |
| 30 | + description="Command Line Interface for PyScript", |
| 31 | + package_dir={"": "src"}, |
| 32 | + packages=find_packages(where="src"), |
| 33 | + package_data={"pyscript": ["templates/*.html"]}, |
| 34 | + long_description=long_description, |
| 35 | + long_description_content_type="text/markdown", |
| 36 | + url="https://github.com/pyscript/pyscript-cli", |
| 37 | + author="Matt Kramer, Fabio Pliger, Nicholas Tollervey, Fabio Rosado, Madhur Tandon", |
| 38 | + author_email=( |
| 39 | + "mkramer@anaconda.com, " |
| 40 | + "fpliger@anaconda.com, " |
| 41 | + "ntollervey@anaconda.com, " |
| 42 | + "frosado@anaconda.com, " |
| 43 | + "mtandon@anaconda.com" |
| 44 | + ), |
| 45 | + license="Apache-2.0", |
| 46 | + install_requires=[ |
| 47 | + 'importlib-metadata; python_version<"3.8"', |
| 48 | + "Jinja2<3.2", |
| 49 | + "pluggy<1.3", |
| 50 | + "rich<=13.7.1", |
| 51 | + "toml<0.11", |
| 52 | + "typer<=0.9.0", |
| 53 | + "platformdirs<4.3", |
| 54 | + "requests<=2.31.0", |
| 55 | + ], |
| 56 | + python_requires=">=3.9", |
| 57 | + keywords=["pyscript", "cli", "pyodide", "micropython", "pyscript-cli"], |
| 58 | + classifiers=[ |
| 59 | + "Development Status :: 4 - Beta", |
| 60 | + "Environment :: Console", |
| 61 | + "Intended Audience :: Developers", |
| 62 | + "License :: OSI Approved :: Apache Software License", |
| 63 | + "Programming Language :: Python :: 3", |
| 64 | + "Programming Language :: Python :: 3.9", |
| 65 | + "Programming Language :: Python :: 3.10", |
| 66 | + "Topic :: Software Development :: Code Generators", |
| 67 | + "Topic :: Software Development :: Libraries :: Python Modules", |
| 68 | + "Topic :: Software Development :: Pre-processors", |
| 69 | + ], |
| 70 | + extras_require={ |
| 71 | + "dev": [ |
| 72 | + "coverage<7.3", |
| 73 | + "mypy<=1.4.1", |
| 74 | + "pytest<7.5", |
| 75 | + "types-toml<0.11", |
| 76 | + "types-requests", |
| 77 | + ], |
| 78 | + "docs": [ |
| 79 | + "Sphinx<5.2", |
| 80 | + "sphinx-autobuild<2021.4.0", |
| 81 | + "sphinx-autodoc-typehints<1.20", |
| 82 | + "myst-parser<0.19.3", |
| 83 | + "pydata-sphinx-theme<0.13.4", |
| 84 | + ], |
| 85 | + }, |
| 86 | + entry_points={ |
| 87 | + "console_scripts": [ |
| 88 | + "pyscript = pyscript.cli:app", |
| 89 | + ], |
| 90 | + }, |
| 91 | + project_urls={ |
| 92 | + "Documentation": "https://docs.pyscript.net", |
| 93 | + "Examples": "https://pyscript.com/@examples", |
| 94 | + "Homepage": "https://pyscript.net", |
| 95 | + "Repository": "https://github.com/pyscript/pyscript-cli", |
| 96 | + }, |
| 97 | + zip_safe=False, |
| 98 | +) |
0 commit comments