Skip to content

Commit 103e63b

Browse files
committed
fix sdist
1 parent 3a3ad3f commit 103e63b

File tree

4 files changed

+25
-42
lines changed

4 files changed

+25
-42
lines changed

src/py/reactpy/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22

33
# --- Build Artifacts ---
44
reactpy/_static
5+
js

src/py/reactpy/pyproject.toml

+16-40
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ readme = "README.md"
1212
requires-python = ">=3.9"
1313
license = "MIT"
1414
keywords = ["react", "javascript", "reactpy", "component"]
15-
authors = [
16-
{ name = "Ryan Morshead", email = "[email protected]" },
17-
]
15+
authors = [{ name = "Ryan Morshead", email = "[email protected]" }]
1816
classifiers = [
1917
"Development Status :: 4 - Beta",
2018
"Programming Language :: Python",
@@ -39,33 +37,18 @@ dependencies = [
3937
[project.optional-dependencies]
4038
all = ["reactpy[starlette,sanic,fastapi,flask,tornado,testing]"]
4139

42-
starlette = [
43-
"starlette >=0.13.6",
44-
"uvicorn[standard] >=0.19.0",
45-
]
40+
starlette = ["starlette >=0.13.6", "uvicorn[standard] >=0.19.0"]
4641
sanic = [
4742
"sanic >=21",
4843
"sanic-cors",
4944
"tracerite>=1.1.1",
5045
"setuptools",
5146
"uvicorn[standard] >=0.19.0",
5247
]
53-
fastapi = [
54-
"fastapi >=0.63.0",
55-
"uvicorn[standard] >=0.19.0",
56-
]
57-
flask = [
58-
"flask",
59-
"markupsafe>=1.1.1,<2.1",
60-
"flask-cors",
61-
"flask-sock",
62-
]
63-
tornado = [
64-
"tornado",
65-
]
66-
testing = [
67-
"playwright",
68-
]
48+
fastapi = ["fastapi >=0.63.0", "uvicorn[standard] >=0.19.0"]
49+
flask = ["flask", "markupsafe>=1.1.1,<2.1", "flask-cors", "flask-sock"]
50+
tornado = ["tornado"]
51+
testing = ["playwright"]
6952

7053
[project.urls]
7154
Source = "https://github.com/reactive-python/reactpy"
@@ -101,13 +84,10 @@ cov-report = [
10184
# "- coverage combine",
10285
"coverage report",
10386
]
104-
cov = [
105-
"test-cov {args}",
106-
"cov-report",
107-
]
87+
cov = ["test-cov {args}", "cov-report"]
10888

10989
[tool.hatch.envs.default.env-vars]
110-
REACTPY_DEBUG_MODE="1"
90+
REACTPY_DEBUG_MODE = "1"
11191

11292
[tool.hatch.envs.lint]
11393
features = ["all"]
@@ -124,16 +104,16 @@ dependencies = [
124104
types = "mypy --strict reactpy"
125105
all = ["types"]
126106

107+
[tool.hatch.build.targets.sdist]
108+
artifacts = ["js"]
109+
127110
[[tool.hatch.build.hooks.build-scripts.scripts]]
128-
work_dir = "../../js"
129111
out_dir = "reactpy/_static"
130112
commands = [
131-
"npm ci",
132-
"npm run build"
133-
]
134-
artifacts = [
135-
"app/dist/"
113+
"if [ ! -d js ]; then ln -s ../../js js; fi",
114+
"cd js && npm ci && npm run build; echo 'done'",
136115
]
116+
artifacts = ["js/app/dist/"]
137117

138118
# --- Pytest ---------------------------------------------------------------------------
139119

@@ -159,9 +139,7 @@ warn_unused_ignores = true
159139
source_pkgs = ["reactpy"]
160140
branch = false
161141
parallel = false
162-
omit = [
163-
"reactpy/__init__.py",
164-
]
142+
omit = ["reactpy/__init__.py"]
165143

166144
[tool.coverage.report]
167145
fail_under = 100
@@ -174,6 +152,4 @@ exclude_lines = [
174152
"if __name__ == .__main__.:",
175153
"if TYPE_CHECKING:",
176154
]
177-
omit = [
178-
"reactpy/__main__.py",
179-
]
155+
omit = ["reactpy/__main__.py"]

src/py/reactpy/reactpy/backend/_common.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
MODULES_PATH = PATH_PREFIX / "modules"
2222
ASSETS_PATH = PATH_PREFIX / "assets"
2323
STREAM_PATH = PATH_PREFIX / "stream"
24-
CLIENT_BUILD_DIR = Path(_reactpy_file_path).parent / "_static" / "app" / "dist"
24+
CLIENT_BUILD_DIR = Path(_reactpy_file_path).parent / "_static" / "js" / "app" / "dist"
2525

2626

2727
async def serve_with_uvicorn(

tasks.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,14 @@ def prepare_py_release(
417417

418418
def publish(dry_run: bool):
419419
with context.cd(package.path):
420+
context.run("twine check dist/*")
421+
422+
# check sdist install
423+
context.run("pip install ./dist/*.tar.gz")
424+
# check wheel install
425+
context.run("pip install ./dist/*.whl")
426+
420427
if dry_run:
421-
context.run("twine check dist/*")
422428
return
423429

424430
context.run(

0 commit comments

Comments
 (0)