From aa9617163388736ba10bd259e78779ea09ea69e1 Mon Sep 17 00:00:00 2001 From: Aran-Fey Date: Sun, 28 Apr 2024 19:33:15 +0200 Subject: [PATCH] update publishing script --- pyproject.toml | 2 ++ requirements-dev.lock | 24 +++++++++++++++++++++++- requirements.lock | 14 +++++++++++++- scripts/publish_new_release.py | 17 ++++++++++++++--- 4 files changed, 52 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e9682582..b874b9b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,6 +92,8 @@ dev-dependencies = [ "pyright~=1.1.350", "requests~=2.31", "ruff~=0.4.1", + "pandas>=2.2.2", + "polars>=0.20.23", ] managed = true diff --git a/requirements-dev.lock b/requirements-dev.lock index 5875cdc7..ce0dac60 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -42,6 +42,9 @@ distlib==0.3.8 # via virtualenv dnspython==2.6.1 # via pymongo +exceptiongroup==1.2.1 + # via anyio + # via pytest fastapi==0.110.2 # via rio-ui filelock==3.13.4 @@ -66,7 +69,9 @@ idna==3.7 # via httpx # via requests # via yarl -imy==0.2.7 +importlib-metadata==7.1.0 + # via keyring +imy==0.2.8 # via rio-ui iniconfig==2.0.0 # via pytest @@ -97,12 +102,15 @@ mypy-extensions==1.0.0 nodeenv==1.8.0 # via pre-commit # via pyright +numpy==1.26.4 + # via pandas ordered-set==4.1.0 # via introspection packaging==24.0 # via black # via pkg-about # via pytest +pandas==2.2.2 pathspec==0.12.1 # via black pillow==10.2.0 @@ -114,6 +122,7 @@ platformdirs==4.2.0 # via virtualenv pluggy==1.4.0 # via pytest +polars==0.20.23 pre-commit==3.1.1 pycparser==2.22 # via cffi @@ -129,6 +138,7 @@ pytest==7.3.2 # via alt-pytest-asyncio # via rio-ui python-dateutil==2.9.0.post0 + # via pandas # via uniserde python-dotenv==1.0.1 # via uvicorn @@ -137,6 +147,7 @@ python-levenshtein==0.23.0 python-multipart==0.0.9 # via rio-ui pytz==2024.1 + # via pandas # via rio-ui pyyaml==6.0.1 # via pre-commit @@ -170,9 +181,15 @@ starlette==0.37.2 # via fastapi timer-dict==1.0.0 # via rio-ui +tomli==2.0.1 + # via black + # via pkg-about + # via pytest tomlkit==0.12.4 # via rio-ui typing-extensions==4.11.0 + # via anyio + # via black # via fastapi # via introspection # via pydantic @@ -180,6 +197,9 @@ typing-extensions==4.11.0 # via revel # via rio-ui # via uniserde + # via uvicorn +tzdata==2024.1 + # via pandas unicall==0.1.5 # via rio-ui uniserde==0.3.12 @@ -203,3 +223,5 @@ websockets==12.0 # via uvicorn yarl==1.9.4 # via rio-ui +zipp==3.18.1 + # via importlib-metadata diff --git a/requirements.lock b/requirements.lock index ac9abf4e..c9454024 100644 --- a/requirements.lock +++ b/requirements.lock @@ -31,6 +31,9 @@ cryptography==42.0.5 # via secretstorage dnspython==2.6.1 # via pymongo +exceptiongroup==1.2.1 + # via anyio + # via pytest fastapi==0.110.2 # via rio-ui fuzzywuzzy==0.18.0 @@ -50,7 +53,9 @@ idna==3.7 # via anyio # via httpx # via yarl -imy==0.2.7 +importlib-metadata==7.1.0 + # via keyring +imy==0.2.8 # via rio-ui iniconfig==2.0.0 # via pytest @@ -136,9 +141,13 @@ starlette==0.37.2 # via fastapi timer-dict==1.0.0 # via rio-ui +tomli==2.0.1 + # via pkg-about + # via pytest tomlkit==0.12.4 # via rio-ui typing-extensions==4.11.0 + # via anyio # via fastapi # via introspection # via pydantic @@ -146,6 +155,7 @@ typing-extensions==4.11.0 # via revel # via rio-ui # via uniserde + # via uvicorn unicall==0.1.5 # via rio-ui uniserde==0.3.12 @@ -165,3 +175,5 @@ websockets==12.0 # via uvicorn yarl==1.9.4 # via rio-ui +zipp==3.18.1 + # via importlib-metadata diff --git a/scripts/publish_new_release.py b/scripts/publish_new_release.py index 11705a75..551c2082 100644 --- a/scripts/publish_new_release.py +++ b/scripts/publish_new_release.py @@ -1,4 +1,5 @@ import subprocess +import sys from pathlib import Path import requests @@ -10,6 +11,8 @@ PROJECT_DIR = Path(__file__).absolute().parent.parent def main() -> None: + revel.print("Running sanity checks...") + # Make sure we're on the correct branch process = subprocess.run( ["git", "branch", "--show-current"], @@ -28,8 +31,16 @@ def main() -> None: subprocess.run(["rye", "run", "build"], check=True) # Run the test suite - if not tests_pass(): - revel.fatal("The test don't pass") + if tests_pass(): + revel.print("Everything is in order. Publishing...") + else: + # revel.fatal("The test don't pass") + if not revel.select_yes_no( + "The test suite does not pass. Do you want to publish anyway?" + ): + sys.exit(1) + + revel.print("Publishing...") # Merge dev into main and push subprocess.run(["git", "fetch", ".", "dev:main"], check=True) @@ -46,7 +57,7 @@ def get_latest_published_version() -> str: def tests_pass() -> bool: - return subprocess.run(["rye", "test", "--", "-x"], check=True) == 0 + return subprocess.run(["rye", "test", "--", "-x"]) == 0 if __name__ == "__main__":