diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f394a84 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Upload To PyPI + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + pypi-publish: + + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.12' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build uv + uv pip install -r requirements-dev.txt + + - name: Build package + run: python -m build + + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 0f0d8c9..e6b19c2 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ htmlcov .coverage *.egg-info +dist/ venv .python-version diff --git a/README.md b/README.md index b31aa6c..4bc9796 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ any other file containing JSX. ## Supported grammar The full [JSX grammar](https://facebook.github.io/jsx/) is supported. -Here are a few example: +Here are a few examples: ### Normal and self-closing tags diff --git a/pyproject.toml b/pyproject.toml index 3c02256..0221385 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ dynamic = ["version"] [project.optional-dependencies] dev = [ "build", - "twine", "uv", "pytest", "pytest-snapshot", diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..01d680e --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,33 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile pyproject.toml --extra dev -o requirements-dev.txt +build==1.2.1 + # via python-jsx (pyproject.toml) +coverage==7.6.1 + # via pytest-cov +iniconfig==2.0.0 + # via pytest +nodeenv==1.9.1 + # via pyright +packaging==24.1 + # via + # build + # pytest +pluggy==1.5.0 + # via pytest +pyproject-hooks==1.1.0 + # via build +pyright==1.1.378 + # via python-jsx (pyproject.toml) +pytest==8.3.2 + # via + # python-jsx (pyproject.toml) + # pytest-cov + # pytest-snapshot +pytest-cov==5.0.0 + # via python-jsx (pyproject.toml) +pytest-snapshot==0.9.0 + # via python-jsx (pyproject.toml) +ruff==0.6.3 + # via python-jsx (pyproject.toml) +uv==0.4.1 + # via python-jsx (pyproject.toml) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9a56360 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile pyproject.toml -o requirements.txt