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

Update toolchain #249

Merged
merged 5 commits into from
Oct 6, 2024
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
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
92 changes: 49 additions & 43 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,68 @@ on:
branches: ["main"]
workflow_dispatch:

env:
FORCE_COLOR: "1"

jobs:
package:
name: Build & verify package
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hynek/build-and-inspect-python-package@v2
id: baipp

outputs:
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}

tests:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: package

strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7", "pypy-3.8"]
python-version:
- pypy3.9
- pypy3.10
- ${{ fromJson(needs.package.outputs.python-versions) }}

steps:
- uses: "actions/checkout@v2"
- name: Download pre-built packages
uses: actions/download-artifact@v4
with:
name: Packages
path: dist

- uses: "actions/setup-python@v2"
- run: tar xf dist/*.tar.gz --strip-components=1

- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: "Install dependencies"
run: |
set -xe
python -VV
python -m site
python -m pip install --upgrade pip
pip install coverage tox tox-gh-actions
- uses: hynek/setup-cached-uv@v2

- name: "Run tox targets for ${{ matrix.python-version }}"
run: "tox"
- name: Run tox
run: >
uvx --with=tox-uv --with=tox-gh-actions
tox run --installpkg dist/*.whl

- name: "Coverage report"
if: "${{ matrix.python-version == '3.8' }}"
- name: Coverage report
if: ${{ matrix.python-version == '3.12' }}
run: |
coverage report
coverage xml
uvx coverage report
uvx coverage xml

- name: "Upload coverage to Codecov"
if: "${{ matrix.python-version == '3.8' }}"
uses: "codecov/codecov-action@v2"
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.12' }}
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true

package:
name: "Build & verify package"
runs-on: "ubuntu-latest"

steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "3.10"

- name: "Install build, check-wheel-contents, and twine"
run: "python -m pip install build twine check-wheel-contents"
- name: "Build package"
run: "python -m build --sdist --wheel ."
- name: "List result"
run: "ls -l dist"
- name: "Check wheel contents"
run: "check-wheel-contents dist/*.whl"
- name: "Check long_description"
run: "python -m twine check dist/*"
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/.tox
/build
/dist
/honcho/_version.py
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2012 Nick Stenning, http://whiteink.com/
Copyright (c) 2012-2024 Nick Stenning, https://whiteink.com/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

5 changes: 4 additions & 1 deletion honcho/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
__version__ = '1.1.0'
try:
from ._version import __version__
except ImportError:
__version__ = '0.0.0+unknown'
11 changes: 8 additions & 3 deletions honcho/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from collections import ChainMap
from collections import OrderedDict
from collections import defaultdict
from pkg_resources import iter_entry_points

from honcho import __version__
from honcho.environ import Env
Expand All @@ -17,6 +16,11 @@
from honcho.printer import Printer
from honcho import compat, environ

if sys.version_info < (3, 10):
from backports.entry_points_selectable import entry_points
else:
from importlib.metadata import entry_points

logging.basicConfig(format='%(asctime)s [%(process)d] [%(levelname)s] '
'%(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
Expand All @@ -33,8 +37,9 @@
'procfile': 'PROCFILE',
}

export_choices = dict((_export.name, _export)
for _export in iter_entry_points('honcho_exporters'))
export_choices = dict(
(_export.name, _export) for _export in entry_points(group="honcho_exporters")
)


class CommandError(Exception):
Expand Down
57 changes: 57 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[build-system]
requires = ["setuptools", "setuptools_scm[toml]"]
build-backend = "setuptools.build_meta"

[project]
name = "honcho"
description = "Honcho: a Python clone of Foreman. For managing Procfile-based applications."
readme = "README.rst"
authors = [
{name = "Nick Stenning", email = "[email protected]"}
]
license.file = "LICENSE"
keywords = ["sysadmin", "process", "procfile"]
urls."Source" = "https://github.com/nickstenning/honcho"
classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
'backports.entry-points-selectable; python_version<"3.10"',
'colorama; sys_platform=="win32"',
]
dynamic = ["version"]

[project.optional-dependencies]
export = ["jinja2>=3.1.2,<4"]
docs = ["sphinx"]

[project.scripts]
honcho = "honcho.command:main"

[project.entry-points.honcho_exporters]
runit = "honcho.export.runit:Export"
supervisord = "honcho.export.supervisord:Export"
systemd = "honcho.export.systemd:Export"
upstart = "honcho.export.upstart:Export"

[tool.setuptools.packages.find]
where = ["."]
include = ["honcho*"]
exclude = ["tests*"]

[tool.setuptools_scm]
write_to = "honcho/_version.py"
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

78 changes: 0 additions & 78 deletions setup.py

This file was deleted.

12 changes: 7 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py37, py38, py39, py310, pypy37, pypy38, lint
envlist = py38, py39, py310, py311, py312, py313, pypy39, pypy310, lint

[flake8]
max-line-length = 110
Expand All @@ -16,12 +16,14 @@ testpaths = tests

[gh-actions]
python =
3.7: py37
3.8: py38, lint, docs
3.8: py38
3.9: py39
3.10: py310
pypy-3.7: pypy37
pypy-3.8: pypy38
3.11: py311
3.12: py312, lint, docs
3.13: py313
pypy-3.9: pypy39
pypy-3.10: pypy310

[testenv]
extras = export
Expand Down