Skip to content

Commit

Permalink
fix sdist
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed Feb 4, 2024
1 parent 3a3ad3f commit 103e63b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 42 deletions.
1 change: 1 addition & 0 deletions src/py/reactpy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

# --- Build Artifacts ---
reactpy/_static
js
56 changes: 16 additions & 40 deletions src/py/reactpy/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
keywords = ["react", "javascript", "reactpy", "component"]
authors = [
{ name = "Ryan Morshead", email = "[email protected]" },
]
authors = [{ name = "Ryan Morshead", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
Expand All @@ -39,33 +37,18 @@ dependencies = [
[project.optional-dependencies]
all = ["reactpy[starlette,sanic,fastapi,flask,tornado,testing]"]

starlette = [
"starlette >=0.13.6",
"uvicorn[standard] >=0.19.0",
]
starlette = ["starlette >=0.13.6", "uvicorn[standard] >=0.19.0"]
sanic = [
"sanic >=21",
"sanic-cors",
"tracerite>=1.1.1",
"setuptools",
"uvicorn[standard] >=0.19.0",
]
fastapi = [
"fastapi >=0.63.0",
"uvicorn[standard] >=0.19.0",
]
flask = [
"flask",
"markupsafe>=1.1.1,<2.1",
"flask-cors",
"flask-sock",
]
tornado = [
"tornado",
]
testing = [
"playwright",
]
fastapi = ["fastapi >=0.63.0", "uvicorn[standard] >=0.19.0"]
flask = ["flask", "markupsafe>=1.1.1,<2.1", "flask-cors", "flask-sock"]
tornado = ["tornado"]
testing = ["playwright"]

[project.urls]
Source = "https://github.com/reactive-python/reactpy"
Expand Down Expand Up @@ -101,13 +84,10 @@ cov-report = [
# "- coverage combine",
"coverage report",
]
cov = [
"test-cov {args}",
"cov-report",
]
cov = ["test-cov {args}", "cov-report"]

[tool.hatch.envs.default.env-vars]
REACTPY_DEBUG_MODE="1"
REACTPY_DEBUG_MODE = "1"

[tool.hatch.envs.lint]
features = ["all"]
Expand All @@ -124,16 +104,16 @@ dependencies = [
types = "mypy --strict reactpy"
all = ["types"]

[tool.hatch.build.targets.sdist]
artifacts = ["js"]

[[tool.hatch.build.hooks.build-scripts.scripts]]
work_dir = "../../js"
out_dir = "reactpy/_static"
commands = [
"npm ci",
"npm run build"
]
artifacts = [
"app/dist/"
"if [ ! -d js ]; then ln -s ../../js js; fi",
"cd js && npm ci && npm run build; echo 'done'",
]
artifacts = ["js/app/dist/"]

# --- Pytest ---------------------------------------------------------------------------

Expand All @@ -159,9 +139,7 @@ warn_unused_ignores = true
source_pkgs = ["reactpy"]
branch = false
parallel = false
omit = [
"reactpy/__init__.py",
]
omit = ["reactpy/__init__.py"]

[tool.coverage.report]
fail_under = 100
Expand All @@ -174,6 +152,4 @@ exclude_lines = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
omit = [
"reactpy/__main__.py",
]
omit = ["reactpy/__main__.py"]
2 changes: 1 addition & 1 deletion src/py/reactpy/reactpy/backend/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
MODULES_PATH = PATH_PREFIX / "modules"
ASSETS_PATH = PATH_PREFIX / "assets"
STREAM_PATH = PATH_PREFIX / "stream"
CLIENT_BUILD_DIR = Path(_reactpy_file_path).parent / "_static" / "app" / "dist"
CLIENT_BUILD_DIR = Path(_reactpy_file_path).parent / "_static" / "js" / "app" / "dist"


async def serve_with_uvicorn(
Expand Down
8 changes: 7 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,14 @@ def prepare_py_release(

def publish(dry_run: bool):
with context.cd(package.path):
context.run("twine check dist/*")

# check sdist install
context.run("pip install ./dist/*.tar.gz")
# check wheel install
context.run("pip install ./dist/*.whl")

if dry_run:
context.run("twine check dist/*")
return

context.run(
Expand Down

0 comments on commit 103e63b

Please sign in to comment.