Skip to content

Commit 2d47d84

Browse files
authoredAug 26, 2024··
Fix release (#152)
* version gatekeep while releasing * version gatekeep while releasing * linting * fix linting * add check_version env * linting * fix jinja stuff * linting * fix linting again * include version file * add zip_safe as False
1 parent 3dfba42 commit 2d47d84

File tree

7 files changed

+137
-117
lines changed

7 files changed

+137
-117
lines changed
 

‎.github/workflows/publish.yaml

-51
This file was deleted.

‎.github/workflows/release.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 build tools
26+
run: |
27+
pip install --upgrade build
28+
29+
- name: Build and package
30+
env:
31+
CHECK_VERSION: 'true'
32+
run: |
33+
python -m build
34+
35+
- name: Upload to PyPI
36+
uses: pypa/gh-action-pypi-publish@release/v1

‎MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include src/pyscript/version

‎pyproject.toml

-65
This file was deleted.

‎setup.py

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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+
)

‎src/pyscript/version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.3.0

‎tests/test_generator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def check_plugin_project_files(
238238
f""" <div>
239239
<h2> Description </h2>
240240
<p>{ plugin_description }</p>
241-
</div>"""
241+
</div>""" # noqa: E201, E202
242242
)
243243
assert f'<py-script src="./{python_file}">' in contents
244244
assert f'<py-config src="./{config_file}">' in contents

0 commit comments

Comments
 (0)
Please sign in to comment.