-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the CI and project structure to perform better tests and conform to more modern practices when it comes to Python projects. Also bumps the version to 1.3.0 in preparation for the next release. Signed-off-by: Jordan Borean <[email protected]>
- Loading branch information
Showing
13 changed files
with
430 additions
and
349 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,98 @@ | ||
name: Test ansibug | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
|
||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
name: build sdist and wheel | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: build sdist and wheel | ||
run: | | ||
set -ex | ||
python -m pip install build | ||
python -m build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifact | ||
path: ./dist/* | ||
|
||
test: | ||
name: test | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: ./dist | ||
|
||
- name: Test | ||
shell: bash | ||
run: | | ||
set -ex | ||
TOX_PYTHON=py$( echo '${{ matrix.python-version }}' | tr -d . ) | ||
sudo apt update | ||
sudo apt install -y libkrb5-dev | ||
ls -al dist | ||
python -Im pip install tox | ||
python -Im tox run \ | ||
-f sanity \ | ||
-f py"${TOX_PYTHON}" \ | ||
--installpkg dist/*.whl | ||
env: | ||
PYTEST_ADDOPTS: --color=yes --junitxml junit/test-results.xml | ||
|
||
publish: | ||
name: publish | ||
needs: | ||
- test | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: ./dist | ||
|
||
- name: Publish | ||
if: startsWith(github.event.release.tag_name, 'v') | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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 |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
env/ | ||
build/ | ||
dist/ | ||
.tox/ | ||
requests_gssapi.egg-info/ | ||
|
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,104 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools >= 61.0.0", # Support for setuptools config in pyproject.toml | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "requests-gssapi" | ||
description = "A GSSAPI authentication handler for python-requests" | ||
readme = "README.rst" | ||
requires-python = ">=3.8" | ||
license = { file = "LICENSE" } | ||
authors = [ | ||
{ name = "Robbie Harwood", email = "[email protected]" }, | ||
{ name = "Ian Cordasco" }, | ||
{ name = "Cory Benfield" }, | ||
{ name = "Michael Komitee" }, | ||
] | ||
keywords = ["ansible", "debug", "lsp", "dap"] | ||
classifiers = [ | ||
"License :: OSI Approved :: ISC License (ISCL)", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
dependencies = [ | ||
"requests >= 1.1.0", | ||
"gssapi", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
homepage = "https://github.com/pythongssapi/requests-gssapi" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"black == 24.2.0", | ||
"isort == 5.13.2", | ||
"pytest", | ||
"tox >= 4.0.0", | ||
] | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "requests_gssapi.__version__" } | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.black] | ||
line-length = 120 | ||
include = '\.pyi?$' | ||
exclude = ''' | ||
/( | ||
\.git | ||
| \.hg | ||
| \.mypy_cache | ||
| \.tox | ||
| \.venv | ||
| _build | ||
| buck-out | ||
| build | ||
| dist | ||
)/ | ||
''' | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--import-mode=importlib" | ||
testpaths = "tests" | ||
junit_family = "xunit2" | ||
|
||
[tool.tox] | ||
legacy_tox_ini = """ | ||
[tox] | ||
env_list = | ||
sanity | ||
py3{8,9,10,11,12}-tests | ||
min_version = 4.0 | ||
[testenv] | ||
package = wheel | ||
wheel_build_env = .pkg | ||
extras = | ||
dev | ||
install_command = python -Im pip install --no-compile {opts} {packages} | ||
passenv = | ||
PYTEST_ADDOPTS | ||
commands = | ||
sanity: python -m black . --check | ||
sanity: python -m isort . --check-only | ||
tests: python -m pytest -v | ||
""" |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.