Skip to content

Commit

Permalink
Merge pull request #22 from hugovk/migrate-to-hatchling
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Sep 8, 2022
2 parents ffafea9 + 34a16fa commit 67c4cb3
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 108 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max_line_length = 88
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
python-version: "3.10"
cache: pip
cache-dependency-path: setup.cfg
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ jobs:
matrix:
python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10", "3.11-dev"]
os: [windows-latest, macos-latest, ubuntu-latest]
include:
# Include new variables for Codecov
- { codecov-flag: GHA_macOS, os: macos-latest }
- { codecov-flag: GHA_Ubuntu, os: ubuntu-latest }
- { codecov-flag: GHA_Windows, os: windows-latest }

steps:
- uses: actions/checkout@v3
Expand All @@ -27,7 +22,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "setup.py"
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
Expand All @@ -45,9 +40,9 @@ jobs:
tox -e cog
- name: Upload coverage
uses: codecov/codecov-action@v3.1.0
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.codecov-flag }}
flags: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

success:
Expand Down
56 changes: 52 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -34,7 +35,6 @@ MANIFEST
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
pip-wheel-metadata/

# Unit test / coverage reports
htmlcov/
Expand All @@ -46,8 +46,10 @@ htmlcov/
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -57,6 +59,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -69,6 +72,7 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -79,10 +83,38 @@ profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand Down Expand Up @@ -110,3 +142,19 @@ venv.bak/
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
21 changes: 10 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.8.0
hooks:
- id: black
args: [--target-version=py37]
Expand All @@ -17,7 +17,7 @@ repos:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
Expand All @@ -37,24 +37,23 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
args: [--max-py-version=3.11]

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.3.4
rev: 0.3.5
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.10.1
hooks:
- id: validate-pyproject

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.5.2
hooks:
- id: tox-ini-fmt

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
rev: v3.0.0-alpha.0
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
Expand Down
73 changes: 70 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,76 @@
[build-system]
build-backend = "setuptools.build_meta"
build-backend = "hatchling.build"
requires = [
"setuptools>=45",
"setuptools_scm[toml]>=6.2",
"hatch-vcs",
"hatchling",
]

[project]
name = "pepotron"
description = "CLI to open PEPs in your browser"
readme = "README.md"
keywords = [
"bpo",
"cli",
"pep",
]
license = {text = "MIT"}
authors = [{name = "Hugo van Kemenade"}]
requires-python = ">=3.7"
dependencies = [
"httpx>=0.22",
'importlib-metadata; python_version < "3.8"',
"platformdirs",
"python-slugify",
"thefuzz",
]
dynamic = [
"version",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
[project.optional-dependencies]
tests = [
"freezegun",
"pytest",
"pytest-cov",
]

[project.urls]
Changelog = "https://github.com/hugovk/pepotron/releases"
Homepage = "https://github.com/hugovk/pepotron"
Source = "https://github.com/hugovk/pepotron"

[project.scripts]
bpo = "pepotron.cli:bpo"
pep = "pepotron.cli:main"


[tool.black]
target_version = ["py37"]

[tool.hatch]
version.source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
addopts = "--color=yes"
68 changes: 0 additions & 68 deletions setup.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions setup.py

This file was deleted.

3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
envlist =
cog
lint
py{311, 310, 39, 38, 37}
py{py3, 311, 310, 39, 38, 37}
isolated_build = true

[testenv]
extras =
Expand Down

0 comments on commit 67c4cb3

Please sign in to comment.