-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
166 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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,79 @@ | ||
name: Publish to PyPI | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
name: "Build dists" | ||
runs-on: "ubuntu-latest" | ||
environment: | ||
name: "publish" | ||
outputs: | ||
hashes: ${{ steps.hash.outputs.hashes }} | ||
|
||
steps: | ||
- name: "Checkout repository" | ||
uses: "actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3" | ||
|
||
- name: "Setup Python" | ||
uses: "actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b" | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: "Install dependencies" | ||
run: python -m pip install build==0.8.0 | ||
|
||
- name: "Build dists" | ||
run: | | ||
SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) \ | ||
python -m build | ||
- name: "Generate hashes" | ||
id: hash | ||
run: | | ||
cd dist && echo "::set-output name=hashes::$(sha256sum * | base64 -w0)" | ||
- name: "Upload dists" | ||
uses: "actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce" | ||
with: | ||
name: "dist" | ||
path: "dist/" | ||
if-no-files-found: error | ||
retention-days: 5 | ||
|
||
provenance: | ||
needs: [build] | ||
permissions: | ||
actions: read | ||
contents: write | ||
id-token: write # Needed to access the workflow's OIDC identity. | ||
uses: "slsa-framework/slsa-github-generator/.github/workflows/[email protected]" | ||
with: | ||
base64-subjects: "${{ needs.build.outputs.hashes }}" | ||
upload-assets: true | ||
compile-generator: true # Workaround for https://github.com/slsa-framework/slsa-github-generator/issues/1163 | ||
|
||
publish: | ||
name: "Publish" | ||
if: startsWith(github.ref, 'refs/tags/') | ||
needs: ["build", "provenance"] | ||
permissions: | ||
contents: write | ||
id-token: write | ||
runs-on: "ubuntu-latest" | ||
|
||
steps: | ||
- name: "Download dists" | ||
uses: "actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a" | ||
with: | ||
name: "dist" | ||
path: "dist/" | ||
|
||
- name: "Publish dists to PyPI" | ||
uses: "pypa/gh-action-pypi-publish@48b317d84d5f59668bb13be49d1697e36b3ad009" |
This file contains 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 |
---|---|---|
|
@@ -10,3 +10,4 @@ docs/_build | |
tags | ||
build/ | ||
dist/ | ||
.pytest_cache/* |
This file contains 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 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,2 +1,71 @@ | ||
[wheel] | ||
[metadata] | ||
name = betamax | ||
version = attr: betamax.__version__ | ||
description = A VCR imitation for python-requests | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
url = https://github.com/sigmavirus24/betamax | ||
author = Ian Stapleton Cordasco | ||
author_email = [email protected] | ||
license = Apache-2.0 | ||
license_files = LICENSE | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: Apache Software License | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Programming Language :: Python :: 3.11 | ||
Programming Language :: Python :: Implementation :: CPython | ||
Programming Language :: Python :: Implementation :: PyPy | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
Topic :: Software Development :: Quality Assurance | ||
|
||
[options] | ||
packages = find: | ||
include_package_data = True | ||
install_requires = | ||
requests >= 2.0 | ||
python_requires = >=3.8.1 | ||
package_dir = | ||
=src | ||
|
||
[options.packages.find] | ||
where = src | ||
exclude = | ||
tests | ||
tests.integration | ||
|
||
[options.package_data] | ||
* = LICENSE AUTHORS.rst HISTORY.rst README.rst | ||
|
||
[options.entry_points] | ||
pytest11 = | ||
pytest-betamax = betamax.fixtures.pytest | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[coverage:run] | ||
source = | ||
betamax | ||
tests | ||
plugins = covdefaults | ||
|
||
#[coverage:report] | ||
#fail_under = 70 | ||
|
||
#[mypy] | ||
#check_untyped_defs = true | ||
#disallow_any_generics = true | ||
#disallow_incomplete_defs = true | ||
#disallow_untyped_defs = true | ||
#no_implicit_optional = true | ||
#warn_unused_ignores = true | ||
# | ||
#[mypy-tests.*] | ||
#disallow_untyped_defs = false |
This file contains 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,69 +1,4 @@ | ||
"""Packaging logic for betamax.""" | ||
import os | ||
import re | ||
import sys | ||
|
||
import setuptools | ||
|
||
packages = setuptools.find_packages( | ||
"src", | ||
exclude=["tests", "tests.integration"], | ||
) | ||
requires = ["requests >= 2.0"] | ||
|
||
__version__ = "" | ||
with open("src/betamax/__init__.py", "r") as fd: | ||
reg = re.compile(r"__version__ = [\'']([^\'']*)[\'']") | ||
for line in fd: | ||
m = reg.match(line) | ||
if m: | ||
__version__ = m.group(1) | ||
break | ||
|
||
if not __version__: | ||
raise RuntimeError("Cannot find version information") | ||
|
||
if sys.argv[-1] in ["submit", "publish"]: | ||
os.system("python setup.py sdist bdist_wheel upload") | ||
sys.exit() | ||
|
||
|
||
def data_for(filename): | ||
"""Read the file data for a filename.""" | ||
with open(filename) as fd: | ||
content = fd.read() | ||
return content | ||
|
||
|
||
setuptools.setup( | ||
name="betamax", | ||
version=__version__, | ||
description="A VCR imitation for python-requests", | ||
long_description="\n\n".join([data_for("README.rst"), | ||
data_for("HISTORY.rst")]), | ||
license="Apache 2.0", | ||
author="Ian Stapleton Cordasco", | ||
author_email="[email protected]", | ||
url="https://github.com/sigmavirus24/betamax", | ||
packages=packages, | ||
package_dir={"": "src"}, | ||
package_data={"": ["LICENSE", "AUTHORS.rst"]}, | ||
include_package_data=True, | ||
install_requires=requires, | ||
entry_points={ | ||
"pytest11": ["pytest-betamax = betamax.fixtures.pytest"] | ||
}, | ||
python_requires='>=3.8', | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved", | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
] | ||
) | ||
setuptools.setup() |
This file contains 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 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 @@ | ||
{"http_interactions": [], "recorded_with": "betamax/0.8.2"} |
This file contains 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 @@ | ||
{"http_interactions": [], "recorded_with": "betamax/0.8.2"} |
This file contains 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