-
Notifications
You must be signed in to change notification settings - Fork 130
workflows: add a release workflow #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
eb0d353
workflows: add a release workflow
woodruffw 024613f
Update .github/workflows/release.yml
woodruffw c2affd9
treewide: pyproject-based metadata
woodruffw 2497561
pyproject: fix typo
woodruffw 262a199
tox: use isolated builds
woodruffw 2da358b
pyproject: include `build` in dev-deps
woodruffw f3e4222
pyproject: include tests in sdist
woodruffw cbd9682
Merge branch 'master' into trusted-publishing
woodruffw 891f948
Merge remote-tracking branch 'origin/master' into trusted-publishing
woodruffw ee0c4ec
Merge remote-tracking branch 'origin/master' into trusted-publishing
woodruffw 9b65bd9
meta: dedupe version, use `bump`
woodruffw 703a191
Makefile, pyproject: remove bump
woodruffw 226213a
CONTRIBUTING: initial contributing docs
woodruffw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 0.13.0 | ||
files = setup.py cachecontrol/__init__.py docs/conf.py | ||
files = cachecontrol/__init__.py docs/conf.py | ||
commit = True | ||
tag = True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
name: release | ||
|
||
jobs: | ||
pypi: | ||
name: upload release to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# Used to authenticate to PyPI via OIDC. | ||
# Used to sign the release's artifacts with sigstore-python. | ||
id-token: write | ||
|
||
# Used to attach signing artifacts to the published release. | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ">= 3.6" | ||
|
||
- name: deps | ||
run: python -m pip install -U build | ||
|
||
- name: build | ||
run: python -m build | ||
|
||
- name: publish | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- name: sign | ||
uses: sigstore/gh-action-sigstore-python@v1.2.3 | ||
with: | ||
inputs: ./dist/*.tar.gz ./dist/*.whl | ||
release-signing-artifacts: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# Contributing to CacheControl | ||
|
||
Thank you for your interest in contributing to `CacheControl`! | ||
|
||
The information below will help you set up a local development environment | ||
and perform common development tasks. | ||
|
||
## Requirements | ||
|
||
`CacheControl`'s only external development requirement is Python 3.7 or newer. | ||
|
||
## Development steps | ||
|
||
First, clone this repository: | ||
|
||
```bash | ||
git clone https://github.com/psf/cachecontrol | ||
cd cachecontrol | ||
``` | ||
|
||
Then, bootstrap your local development environment: | ||
|
||
```bash | ||
make bootstrap | ||
# OPTIONAL: enter the new environment, if you'd like to run things directly | ||
source .venv/bin/activate | ||
``` | ||
|
||
Once you've run `make bootstrap`, you can run the other `make` targets | ||
to perform particular tasks. | ||
|
||
Any changes you make to the `cachecontrol` source tree will take effect | ||
immediately in the development environment. | ||
|
||
### Linting | ||
|
||
You can run the current formatters with: | ||
|
||
```bash | ||
make format | ||
``` | ||
|
||
### Testing | ||
|
||
You can run the unit tests locally with: | ||
|
||
```bash | ||
# run the test suite in the current environment | ||
make test | ||
|
||
# OPTIONAL: use `tox` to fan out across multiple interpreters | ||
make test-all | ||
``` | ||
|
||
### Documentation | ||
|
||
You can build the Sphinx-based documentation with: | ||
|
||
```bash | ||
# puts the generated HTML in docs/_build/html/ | ||
make doc | ||
``` | ||
|
||
### Releasing | ||
|
||
**NOTE**: If you're a non-maintaining contributor, you don't need the steps | ||
here! They're documented for completeness and for onboarding future maintainers. | ||
|
||
Releases of `CacheControl` are managed by GitHub Actions. | ||
|
||
To perform a release: | ||
|
||
1. Update `CacheControl`'s `__version__` attribute. It can be found under | ||
`cachecontrol/__init__.py`. | ||
|
||
1. Create a new tag corresponding to your new version, with a `v` prefix. For example: | ||
|
||
```bash | ||
# IMPORTANT: don't forget the `v` prefix! | ||
git tag v1.2.3 | ||
``` | ||
|
||
1. Push your changes to `master` and to the new remote tag. | ||
|
||
1. Create, save, and publish a GitHub release for your new tag, including any | ||
`CHANGELOG` entries. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
[build-system] | ||
requires = ["flit_core >=3.2,<4"] | ||
build-backend = "flit_core.buildapi" | ||
|
||
[tool.flit.module] | ||
name = "cachecontrol" | ||
|
||
[tool.flit.sdist] | ||
include = ["tests/"] | ||
|
||
[project] | ||
name = "CacheControl" | ||
dynamic = ["version"] | ||
description = "httplib2 caching for requests" | ||
readme = "README.rst" | ||
license = { file = "LICENSE.txt" } | ||
authors = [ | ||
{ name = "Eric Larson", email = "ericlarson@ionrock.com" }, | ||
{ name = "Frost Ming", email = "me@frostming.com" }, | ||
{ name = "William Woodruff", email = "william@yossarian.net" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Environment :: Web Environment", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"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", | ||
"Programming Language :: Python :: 3.11", | ||
"Topic :: Internet :: WWW/HTTP", | ||
] | ||
keywords = ["requests", "http", "caching", "web"] | ||
dependencies = ["requests >= 2.16.0", "msgpack >= 0.5.2"] | ||
requires-python = ">=3.7" | ||
|
||
[project.urls] | ||
Homepage = "https://pypi.org/project/CacheControl/" | ||
Issues = "https://github.com/psf/cachecontrol/issues" | ||
Source = "https://github.com/psf/cachecontrol" | ||
woodruffw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[project.optional-dependencies] | ||
# End-user extras. | ||
filecache = ["filelock >= 3.8.0"] | ||
redis = ["redis>=2.10.5"] | ||
|
||
# Development extras. | ||
dev = [ | ||
"CacheControl[filecache,redis]", | ||
"build", | ||
"mypy", | ||
"tox", | ||
"pytest-cov", | ||
"pytest", | ||
"cherrypy", | ||
"sphinx", | ||
"black", | ||
"types-redis", | ||
"types-requests", | ||
] | ||
|
||
[project.scripts] | ||
doesitcache = "cachecontrol._cmd:main" | ||
|
||
[tool.mypy] | ||
show_error_codes = true | ||
strict = true | ||
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] | ||
|
||
[[tool.mypy.overrides]] | ||
module = "msgpack" | ||
ignore_missing_imports = true | ||
|
||
[tool.pytest.ini_options] | ||
norecursedirs = ["bin", "lib", "include", "build"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.