From bda5569822a72068a201c1b92c612316068204f4 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 22 Sep 2022 15:03:51 -0500 Subject: [PATCH] Switch to using hatch version (#186) --- .github/workflows/check-release.yml | 8 -------- .github/workflows/test.yml | 10 ++++++++-- RELEASE.md | 11 +++++------ pyproject.toml | 22 ++++------------------ 4 files changed, 17 insertions(+), 34 deletions(-) diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index ab41011..62b96d4 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -11,10 +11,6 @@ concurrency: jobs: check_release: runs-on: ubuntu-latest - strategy: - matrix: - group: [check_release, link_check] - fail-fast: false steps: - uses: actions/checkout@v2 - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 @@ -22,10 +18,6 @@ jobs: run: | pip install -e . - name: Check Release - if: ${{ matrix.group == 'check_release' }} uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - - name: Run Link Check - if: ${{ matrix.group == 'link_check' }} - uses: jupyter-server/jupyter_releaser/.github/actions/check-links@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fe5b157..740fc1e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,14 +94,20 @@ jobs: - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - uses: jupyterlab/maintainer-tools/.github/actions/test-sdist@v1 + check-links: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 + # Run "pre-commit run --all-files --hook-stage=manual" pre-commit: name: Run pre-commit hook runs-on: ubuntu-latest timeout-minutes: 5 steps: - - name: Checkout - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v3 - name: Run pre-commit diff --git a/RELEASE.md b/RELEASE.md index 6572bfd..8c1cf8a 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,14 +4,13 @@ To create a manual release, update the version number in `terminado/__init__.py` ``` git clean -dffx -python setup.py sdist -python setup.py bdist_wheel -export script_version=`python setup.py --version 2>/dev/null` +pip install pipx +pipx run build +export script_version=`pipx run hatch version 2>/dev/null` git commit -a -m "Release $script_version" git tag $script_version git push --all git push --tags -pip install twine -twine check dist/* -twine upload dist/* +pipx run twine check dist/* +pipx run twine upload dist/* ``` diff --git a/pyproject.toml b/pyproject.toml index b56d1d5..dc57fc4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["hatchling>=0.25"] +requires = ["hatchling>=1.5"] build-backend = "hatchling.build" [project] name = "terminado" -version = "0.15.0" +dynamic = ["version"] license = { file = "LICENSE" } description = "Tornado websocket backend for the Xterm.js Javascript terminal emulator library." classifiers = [ "Environment :: Web Environment", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", "Topic :: Terminals :: Terminal Emulators/X Terminals",] @@ -28,22 +28,8 @@ test = [ "pytest>=6.0", "pre-commit", "pytest-timeout",] [tool.jupyter-releaser] skip = ["check-links"] -[tool.tbump.version] -current = "0.15.0" -regex = ''' - (?P\d+)\.(?P\d+)\.(?P\d+) - ((?Pa|b|rc|.dev)(?P\d+))? -''' - -[tool.tbump.git] -message_template = "Bump to {new_version}" -tag_template = "v{new_version}" - -[[tool.tbump.file]] -src = "terminado/__init__.py" - -[[tool.tbump.file]] -src = "pyproject.toml" +[tool.hatch.version] +path = "terminado/__init__.py" [tool.pytest.ini_options] addopts = "-raXs --durations 10 --color=yes --doctest-modules"