Skip to content

Commit

Permalink
make setup declarative
Browse files Browse the repository at this point in the history
drop support for python 3.6
  • Loading branch information
Dobatymo committed Aug 8, 2024
1 parent de71824 commit c412864
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 147 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,39 @@ on: [push]

jobs:

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install -U pip wheel
python -m pip install black isort flake8 bandit[toml]
- run: python -m black . --check
- run: python -m isort . --check-only
- run: python -m flake8 .
- run: python -m bandit . --recursive -c pyproject.toml


deploy:
needs: lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
architecture: 'x64'
- name: Build dists
run: |
pip install wheel
python setup.py sdist bdist_wheel
python -m pip install wheel build
python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
101 changes: 59 additions & 42 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,60 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.2.0'
hooks:
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-case-conflict
- id: check-added-large-files
- id: debug-statements
- id: mixed-line-ending
args: ["--fix=no"]
- id: requirements-txt-fixer
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
- id: end-of-file-fixer
- repo: https://github.com/asottile/pyupgrade
rev: 'v2.32.0'
hooks:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/psf/black
rev: '22.3.0'
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
- repo: https://github.com/PyCQA/isort
rev: '5.10.1'
hooks:
- id: isort
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.942'
hooks:
- id: mypy
args: ["--ignore-missing-imports", "--install-types", "--non-interactive"]
additional_dependencies:
- requests
- genutility
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-case-conflict
- id: check-added-large-files
- id: debug-statements
- id: mixed-line-ending
args: [--fix=no]
- id: requirements-txt-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.13.0
hooks:
- id: pretty-format-yaml
args: [--autofix]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-annotations
- flake8-bugbear
- flake8-eradicate
- flake8-mutable
- flake8-simplify
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.1
hooks:
- id: mypy
args: [--ignore-missing-imports, --install-types, --non-interactive]
additional_dependencies:
- requests
- genutility
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
61 changes: 60 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,66 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
]

[project]
name = "rbtv-api"
version = "0.0.8"
description = "Simple Python wrapper for the JSON Rocket Beans TV API"
readme = { file = "readme.md", content-type = "text/markdown" }
authors = [
{ name = "Dobatymo" },
]
requires-python = ">=3.7"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: ISC License (ISCL)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"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",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"genutility[exceptions]",
"requests",
]
optional-dependencies.all = [
"unidecode",
]

urls.Home = "https://github.com/Dobatymo/rbtv-api"

[tool.setuptools]
packages = [
"rbtv",
]

[tool.setuptools.package-data]
rbtv = [
"py.typed",
]

[tool.black]
line-length = 120

[tool.ruff]
line-length = 120

[tool.isort]
profile = "black"
src_paths = ["."]
line_length = 120

[tool.mypy]
allow_redefinition = true
warn_unused_configs = true
warn_unused_ignores = true

[tool.bandit]
skips = [
"B101",
]
Empty file added rbtv/py.typed
Empty file.
Loading

0 comments on commit c412864

Please sign in to comment.