Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert from setuptools to hatchling #64

Merged
merged 4 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
3 changes: 0 additions & 3 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
name: "changelog: skip"

# Other labels
- color: 2d18b2
description: "To automatically merge PRs that are ready"
name: automerge
- color: 0366d6
description: "For dependencies"
name: dependencies
Expand Down
13 changes: 13 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"labels": ["changelog: skip", "dependencies"],
"packageRules": [
{
"groupName": "github-actions",
"matchManagers": ["github-actions"],
"separateMajorMinor": "false"
}
],
"schedule": ["on the first day of the month"]
}
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.x"
cache: pip
cache-dependency-path: setup.cfg
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
Expand All @@ -33,7 +33,6 @@ jobs:

- name: Build package
run: |
python setup.py --version
python -m build
twine check --strict dist/*

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v2.0.3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0
2 changes: 1 addition & 1 deletion .github/workflows/require-pr-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: mheap/github-action-required-labels@v1
- uses: mheap/github-action-required-labels@v2
with:
mode: minimum
count: 1
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,39 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["pypy3.8", "3.7", "3.8", "3.9", "3.10", "3.11"]
os: [macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.cfg
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install -U tox tox-gh-actions
python -m pip install -U tox

- name: Tox tests
run: |
tox -e py

- name: Upload coverage
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
flags: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}

success:
needs: test
runs-on: ubuntu-latest
name: test successful
name: Test successful
steps:
- name: Success
run: echo Test successful
19 changes: 12 additions & 7 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: v3.2.2
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/psf/black
rev: 22.6.0
rev: 22.10.0
hooks:
- id: black
args: [--target-version=py37]
Expand All @@ -18,7 +18,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 @@ -32,17 +32,22 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

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

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

# Skip whilst it strips comments
# - repo: https://github.com/tox-dev/tox-ini-fmt
Expand Down
58 changes: 58 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-vcs",
"hatchling",
]

[project]
name = "osmviz"
description = "OSMViz is a small set of Python tools for retrieving and using Mapnik tiles from a Slippy Map server (you may know these as OpenStreetMap images)."
readme = "README.md"
keywords = [
"osm openstreetmap tiles visualization",
]
license = {text = "MIT"}
maintainers = [{name = "Hugo van Kemenade"}]
authors = [{name = "Colin Bick and Contributors", email = "colin.bick@gmail.com"}]
requires-python = ">=3.7"
dynamic = [
"version",
]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"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",
"Topic :: Software Development :: Documentation",
]
[project.optional-dependencies]
tests = [
"coverage",
"pillow>=9.1",
"pytest",
"pytest-cov",
]

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


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

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

[tool.pytest.ini_options]
addopts = "-W error::DeprecationWarning"
56 changes: 0 additions & 56 deletions setup.cfg

This file was deleted.

12 changes: 0 additions & 12 deletions setup.py

This file was deleted.

10 changes: 1 addition & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
envlist =
lint
py{py3, 311, 310, 39, 38, 37}
isolated_build = true

[testenv]
passenv =
FORCE_COLOR
extras =
tests
commands =
{envpython} setup.py --version
coverage erase

# Unit tests
Expand All @@ -30,11 +30,3 @@ commands =
[testenv:py37]
deps =
tqdm

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
pypy-3: pypy3