Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release

on:
release:
types: [published]
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: extractions/setup-just@v3
- uses: actions/setup-python@v7
with:
python-version: '3.14'
- name: Build package
run: just install build
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Upload assets to release
uses: AButler/upload-release-assets@v3.0.1
with:
files: 'dist/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment on lines +10 to +27
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.egg-info
.cache/
venv/
.venv/
.tox
test-*.xml
.coverage
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,8 @@ Pretty straightforward. Develop in branches, send PRs, land on master. All tests
### Releasing a new version

1. Land all requisite changes
1. Bump the version in `setup.py` and `pystalk/__init__.py` to the stable version (e.g., `0.2`)
1. Bump the version in `setup.py` and `pystalk/__init__.py` to the stable version (e.g., `0.9.0`)
1. Update [`CHANGES.rst`](docs/source/CHANGES.rst) with the changes and the new version number
1. Update [`conf.py`](docs/source/conf.py) with the new version number
1. Commit
1. Tag the version (e.g., `git tag -s pystalk-0.2`)
1. Push up to Github
1. Upload to PyPI with `python setup.py sdist upload`
1. Commit and push up to Github
1. Draft a [new GitHub Release](https://github.com/EasyPost/pystalk/releases/new), targeting a new tag matching the version (e.g., `0.9.0`)
1. Publishing the release triggers the `release` GitHub Actions workflow, which builds the sdist/wheel and publishes them to PyPI automatically
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Install the project and build its dependencies.
install:
python -m pip install --upgrade pip
python -m pip install -e . -r requirements-tests.txt

# build sdist and wheel into dist/
build:
python -m pip install build
python -m build
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[build-system]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're committing to switching to uv over standard venv (which I'm fine with but wasn't intending to be included here), then we should convert the setup.py file to be in this pyproject.toml file to consolidate build metadata. You can use the easypost-python file as a template to follow. You'll then want to remove this repos setup.py file.

requires = ["setuptools>=61", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "pystalk"
description = "Beanstalkd"
dynamic = ["version", "dependencies", "optional-dependencies"]
readme = "README.md"
requires-python = ">=3.6, <4"
license = { file = "LICENSE.txt" }
authors = [{ name = "EasyPost", email = "oss@easypost.com" }]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Topic :: Database",
"License :: OSI Approved :: ISC License (ISCL)",
]

[project.urls]
Source = "https://github.com/easypost/pystalk"

[tool.setuptools.dynamic]
version = { attr = "pystalk.__version__" }
dependencies = { file = ["requirements.txt"] }

[tool.setuptools.dynamic.optional-dependencies]
dev = { file = ["requirements-tests.txt"] }

[tool.setuptools.packages.find]
exclude = ["tests", "tests.*"]
44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

Loading