Skip to content

Commit 4314980

Browse files
committed
version gatekeep while releasing
1 parent 3dfba42 commit 4314980

File tree

4 files changed

+116
-65
lines changed

4 files changed

+116
-65
lines changed

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
environment:
12+
name: pypi
13+
url: https://pypi.org/project/pyscript
14+
permissions:
15+
id-token: write
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: 3.11
24+
25+
- name: Install dependencies
26+
run: pip install -r requirements.txt
27+
28+
- name: Build and package
29+
run: |
30+
pip install wheel
31+
python setup.py sdist bdist_wheel
32+
33+
- name: Upload to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

Lines changed: 0 additions & 65 deletions
This file was deleted.

setup.py

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

src/pyscript/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.3.0

0 commit comments

Comments
 (0)