Skip to content

Commit c5e5305

Browse files
committed
Release 0.9.0
Add support for urllib3 2.x
1 parent 4c400ba commit c5e5305

File tree

9 files changed

+166
-72
lines changed

9 files changed

+166
-72
lines changed

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
name: "Build dists"
14+
runs-on: "ubuntu-latest"
15+
environment:
16+
name: "publish"
17+
outputs:
18+
hashes: ${{ steps.hash.outputs.hashes }}
19+
20+
steps:
21+
- name: "Checkout repository"
22+
uses: "actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3"
23+
24+
- name: "Setup Python"
25+
uses: "actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b"
26+
with:
27+
python-version: "3.x"
28+
29+
- name: "Install dependencies"
30+
run: python -m pip install build==0.8.0
31+
32+
- name: "Build dists"
33+
run: |
34+
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) \
35+
python -m build
36+
37+
- name: "Generate hashes"
38+
id: hash
39+
run: |
40+
cd dist && echo "::set-output name=hashes::$(sha256sum * | base64 -w0)"
41+
42+
- name: "Upload dists"
43+
uses: "actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce"
44+
with:
45+
name: "dist"
46+
path: "dist/"
47+
if-no-files-found: error
48+
retention-days: 5
49+
50+
provenance:
51+
needs: [build]
52+
permissions:
53+
actions: read
54+
contents: write
55+
id-token: write # Needed to access the workflow's OIDC identity.
56+
uses: "slsa-framework/slsa-github-generator/.github/workflows/[email protected]"
57+
with:
58+
base64-subjects: "${{ needs.build.outputs.hashes }}"
59+
upload-assets: true
60+
compile-generator: true # Workaround for https://github.com/slsa-framework/slsa-github-generator/issues/1163
61+
62+
publish:
63+
name: "Publish"
64+
if: startsWith(github.ref, 'refs/tags/')
65+
needs: ["build", "provenance"]
66+
permissions:
67+
contents: write
68+
id-token: write
69+
runs-on: "ubuntu-latest"
70+
71+
steps:
72+
- name: "Download dists"
73+
uses: "actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a"
74+
with:
75+
name: "dist"
76+
path: "dist/"
77+
78+
- name: "Publish dists to PyPI"
79+
uses: "pypa/gh-action-pypi-publish@48b317d84d5f59668bb13be49d1697e36b3ad009"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ docs/_build
1010
tags
1111
build/
1212
dist/
13+
.pytest_cache/*

HISTORY.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
History
22
=======
33

4-
0.8.2 - 2018-10-21
4+
0.9.0 - 2024-02-06
55
------------------
66

7+
- Add support for urllib3 2.0
8+
- Fix documentation
79
- Add support for binary serializer storage;
810
useful with custom serializers (such as pickle based),
911
however all builtin betamax serializers remain text based.

setup.cfg

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,71 @@
1-
[wheel]
1+
[metadata]
2+
name = betamax
3+
version = attr: betamax.__version__
4+
description = A VCR imitation for python-requests
5+
long_description = file: README.rst
6+
long_description_content_type = text/x-rst
7+
url = https://github.com/sigmavirus24/betamax
8+
author = Ian Stapleton Cordasco
9+
author_email = [email protected]
10+
license = Apache-2.0
11+
license_files = LICENSE
12+
classifiers =
13+
Development Status :: 5 - Production/Stable
14+
Intended Audience :: Developers
15+
License :: OSI Approved :: Apache Software License
16+
Programming Language :: Python
17+
Programming Language :: Python :: 3
18+
Programming Language :: Python :: 3 :: Only
19+
Programming Language :: Python :: 3.8
20+
Programming Language :: Python :: 3.9
21+
Programming Language :: Python :: 3.10
22+
Programming Language :: Python :: 3.11
23+
Programming Language :: Python :: Implementation :: CPython
24+
Programming Language :: Python :: Implementation :: PyPy
25+
Topic :: Software Development :: Libraries :: Python Modules
26+
Topic :: Software Development :: Quality Assurance
27+
28+
[options]
29+
packages = find:
30+
include_package_data = True
31+
install_requires =
32+
requests >= 2.0
33+
python_requires = >=3.8.1
34+
package_dir =
35+
=src
36+
37+
[options.packages.find]
38+
where = src
39+
exclude =
40+
tests
41+
tests.integration
42+
43+
[options.package_data]
44+
* = LICENSE AUTHORS.rst HISTORY.rst README.rst
45+
46+
[options.entry_points]
47+
pytest11 =
48+
pytest-betamax = betamax.fixtures.pytest
49+
50+
[bdist_wheel]
251
universal = 1
52+
53+
[coverage:run]
54+
source =
55+
betamax
56+
tests
57+
plugins = covdefaults
58+
59+
#[coverage:report]
60+
#fail_under = 70
61+
62+
#[mypy]
63+
#check_untyped_defs = true
64+
#disallow_any_generics = true
65+
#disallow_incomplete_defs = true
66+
#disallow_untyped_defs = true
67+
#no_implicit_optional = true
68+
#warn_unused_ignores = true
69+
#
70+
#[mypy-tests.*]
71+
#disallow_untyped_defs = false

setup.py

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,4 @@
11
"""Packaging logic for betamax."""
2-
import os
3-
import re
4-
import sys
5-
62
import setuptools
73

8-
packages = setuptools.find_packages(
9-
"src",
10-
exclude=["tests", "tests.integration"],
11-
)
12-
requires = ["requests >= 2.0"]
13-
14-
__version__ = ""
15-
with open("src/betamax/__init__.py", "r") as fd:
16-
reg = re.compile(r"__version__ = [\'']([^\'']*)[\'']")
17-
for line in fd:
18-
m = reg.match(line)
19-
if m:
20-
__version__ = m.group(1)
21-
break
22-
23-
if not __version__:
24-
raise RuntimeError("Cannot find version information")
25-
26-
if sys.argv[-1] in ["submit", "publish"]:
27-
os.system("python setup.py sdist bdist_wheel upload")
28-
sys.exit()
29-
30-
31-
def data_for(filename):
32-
"""Read the file data for a filename."""
33-
with open(filename) as fd:
34-
content = fd.read()
35-
return content
36-
37-
38-
setuptools.setup(
39-
name="betamax",
40-
version=__version__,
41-
description="A VCR imitation for python-requests",
42-
long_description="\n\n".join([data_for("README.rst"),
43-
data_for("HISTORY.rst")]),
44-
license="Apache 2.0",
45-
author="Ian Stapleton Cordasco",
46-
author_email="[email protected]",
47-
url="https://github.com/sigmavirus24/betamax",
48-
packages=packages,
49-
package_dir={"": "src"},
50-
package_data={"": ["LICENSE", "AUTHORS.rst"]},
51-
include_package_data=True,
52-
install_requires=requires,
53-
entry_points={
54-
"pytest11": ["pytest-betamax = betamax.fixtures.pytest"]
55-
},
56-
python_requires='>=3.8',
57-
classifiers=[
58-
"Development Status :: 5 - Production/Stable",
59-
"License :: OSI Approved",
60-
"Intended Audience :: Developers",
61-
"Programming Language :: Python",
62-
"Programming Language :: Python :: 3 :: Only",
63-
"Programming Language :: Python :: 3.8",
64-
"Programming Language :: Python :: 3.9",
65-
"Programming Language :: Python :: 3.10",
66-
"Programming Language :: Python :: 3.11",
67-
"Programming Language :: Python :: Implementation :: CPython",
68-
]
69-
)
4+
setuptools.setup()

src/betamax/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
__all__ = ('BetamaxError', 'Betamax', 'BaseMatcher', 'BaseSerializer',
2020
'use_cassette')
2121
__author__ = 'Ian Stapleton Cordasco'
22-
__copyright__ = 'Copyright 2013-2018 Ian Stapleton Cordasco'
22+
__copyright__ = 'Copyright 2013- Ian Stapleton Cordasco'
2323
__license__ = 'Apache 2.0'
2424
__title__ = 'betamax'
25-
__version__ = '0.8.2'
25+
__version__ = '0.9.0'
2626
__version_info__ = tuple(int(i) for i in __version__.split('.'))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"http_interactions": [], "recorded_with": "betamax/0.8.2"}

tests/cassettes/test_record_once.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"http_interactions": [], "recorded_with": "betamax/0.8.2"}

tox.ini

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ deps =
2121
flake8-docstrings
2222
commands = flake8 {posargs} src/betamax
2323

24+
[testenv:build]
25+
deps =
26+
build
27+
commands =
28+
python -m build
29+
2430
[testenv:release]
2531
deps =
2632
twine >= 1.5.0
27-
wheel
33+
{[testenv:build]deps}
2834
commands =
29-
python setup.py sdist bdist_wheel
35+
{[testenv:build]commands}
3036
twine upload --skip-existing {posargs} dist/*
3137

3238
[testenv:docs]

0 commit comments

Comments
 (0)