Skip to content

Commit

Permalink
Merge pull request #68 from freakboy3742/pep621
Browse files Browse the repository at this point in the history
Switch to PEP621 project format
  • Loading branch information
freakboy3742 committed Feb 5, 2024
2 parents 0c8116d + 2a81d8f commit c92dc56
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 123 deletions.
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates on Sunday, 8PM UTC
interval: "weekly"
day: "sunday"
time: "20:00"

- package-ecosystem: "pip"
directory: "/"
schedule:
# Check for updates on Sunday, 8PM UTC
interval: "weekly"
day: "sunday"
time: "20:00"
39 changes: 34 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ on:
branches:
- main

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

env:
FORCE_COLOR: "1"

jobs:
pretest:
name: Pre-test checks
Expand All @@ -30,7 +41,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
pip install -e .[dev]
- name: Run pre-test checks
run: |
tox -e package
Expand All @@ -40,8 +51,27 @@ jobs:
needs: pretest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
macOS-version: ["macos-11", "macos-12"]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev" ]
macOS-version: [
# x86_64 runners
"macos-11", "macos-12", "macos-13",
# M1 runners
"macos-14",
]

include:
- experimental: false
- python-version: "3.13-dev"
experimental: true

exclude:
# actions/setup-python doesn't provide Python3.8 or 3.9 for M1.
- macOS-version: "macos-14"
python-version: "3.8"

- macOS-version: "macos-14"
python-version: "3.9"

runs-on: ${{ matrix.macOS-version }}
steps:
- uses: actions/checkout@v3.1.0
Expand All @@ -52,8 +82,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
python -m pip install --upgrade tox
pip install -e .[dev]
- name: Test
run: |
tox -e py
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Update pre-commit

on:
schedule:
- cron: "0 20 * * SUN" # Sunday @ 2000 UTC
workflow_dispatch:

jobs:
pre-commit-update:
name: Update pre-commit
uses: beeware/.github/.github/workflows/pre-commit-update.yml@main
with:
create-changenote: false
secrets:
BRUTUS_PAT_TOKEN: ${{ secrets.BRUTUS_PAT_TOKEN }}
20 changes: 12 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-toml
- id: check-yaml
Expand All @@ -9,21 +9,25 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
additional_dependencies: [toml]
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/psf/black
rev: 23.3.0
args: [--py38-plus]
- repo: https://github.com/myint/docformatter
rev: v1.5.0
hooks:
- id: docformatter
args: [--in-place]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
hooks:
- id: black
language_version: python3
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
73 changes: 71 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,81 @@
[build-system]
requires = ["setuptools>=60"]
requires = [
"setuptools==69.0.0",
]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["version"]
name = "dmgbuild"
description = "macOS command line utility to build disk images"
readme = "README.rst"
requires-python = ">= 3.8"
license.text = "New BSD"
authors = [
{name="Alastair Houghton", email="alastair@alastairs-place.net"}
]
maintainers = [
{name="Russell Keith-Magee", email="russell@keith-magee.com"}
]
keywords = [
"dmg"
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"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",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Desktop Environment",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"ds_store >= 1.1.0",
"mac_alias >= 2.0.1",
# importlib.resources wasn't fully featured until Python3.9;
# install the backwards compatibility shim from Python3.12.
"importlib_resources == 5.9; python_version <= '3.8'",
]

[project.urls]
Homepage = "http://alastairs-place.net/projects/dmgbuild"
Source = "https://github.com/dmgbuild/dmgbuild"

[project.scripts]
dmgbuild = "dmgbuild.__main__:main"

[project.optional-dependencies]
dev = [
"coverage == 7.4.1",
# Pre-commit 3.6.0 deprecated support for Python 3.8
"pre-commit == 3.5.0 ; python_version < '3.9'",
"pre-commit == 3.6.0 ; python_version >= '3.9'",
"pytest == 8.0.0",
"pytest-cov == 4.1.0",
"tox == 4.12.1",
]
docs = [
# Sphinx 7.2 deprecated support for Python 3.8
"sphinx == 7.1.2 ; python_version < '3.9'",
"sphinx == 7.2.6 ; python_version >= '3.9'",
"sphinx-autobuild == 2021.3.14",
"sphinx_rtd_theme == 2.0.0"
]

[tool.setuptools.dynamic]
version = {attr = "dmgbuild.__version__"}

[tool.isort]
profile = "black"
split_on_trailing_comma = true
combine_as_imports = true
skip_glob = [
"docs/conf.py",
"venv*",
"local",
]
multi_line_output = 3
79 changes: 0 additions & 79 deletions setup.cfg

This file was deleted.

58 changes: 29 additions & 29 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
# flake8 doesn't believe in pyproject.toml, so we keep the configuration here.
[flake8]
exclude=\
.eggs/*,\
build/*,\
docs/*,\
.tox/*,\
venv*
extend_ignore=C901,E203
max-line-length = 119

[tox]
envlist = flake8,docs,package,py{37,38,39,310,311,312}
envlist = docs,package,py{38,39,310,311,312,313}
skip_missing_interpreters = true
isolated_build = True

[testenv]
extras =
test
dev
commands =
pytest --cov -vv
coverage xml
python -m pytest --cov -vv

[testenv:flake8]
skip_install = True
deps =
flake8
commands = flake8 {posargs}

[testenv:docs]
build_dir = _build
change_dir = docs
extras =
docs
# -W: make warnings into errors
# --keep-going: continue on errors
# -j: run with multiple processes
# -n: nitpick mode
# -v: verbose logging
# -E: force rebuild of environment
# -T: print traceback on error
# -a: read/parse all files
# -d: use tox's temp dir for caching
commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
python -m sphinx build -W --keep-going -j auto -n -v -E -T -a -d _build/doctrees -b html . _build/html

[testenv:package]
skip_install = True
skip-install = True
passenv = FORCE_COLOR
deps =
check_manifest
build
twine
build==1.0.3
twine==4.0.2
commands =
check-manifest -v
python -m build --sdist --wheel --outdir dist/ .
python -m twine check dist/*

[testenv:publish]
deps =
wheel
twine
passenv =
TWINE_USERNAME
TWINE_PASSWORD
commands =
python -m twine upload dist/*

0 comments on commit c92dc56

Please sign in to comment.