Skip to content

Commit

Permalink
Migrate from setup.cfg to pyproject.toml entirely.
Browse files Browse the repository at this point in the history
  • Loading branch information
duckinator committed Oct 19, 2023
1 parent 6ad97a8 commit ec8c059
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 96 deletions.
21 changes: 7 additions & 14 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Allow compute credits usage for collaborators and anything pushed to the
# main, staging, and trying branches. (So bors can use them.)
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true' || $CIRRUS_BRANCH == 'main' || $CIRRUS_BRANCH == 'staging' || $CIRRUS_BRANCH == 'trying'

# http://click.palletsprojects.com/en/5.x/python3/#python-3-surrogate-handling
env:
LC_ALL: C.UTF-8
Expand All @@ -11,7 +7,7 @@ Lint_task:
container:
image: python:3-slim
install_script:
- pip3 install -U .[testing]
- pip3 install -U .[test]
script:
- pylint --version
- bork run lint
Expand All @@ -21,12 +17,11 @@ Linux_task:
allow_failures: $CIRRUS_TASK_NAME =~ '.*-rc-.*'
container:
matrix:
- image: python:3.8-slim
- image: python:3.9-slim
- image: python:3.10-slim
- image: python:3.11-slim
install_script:
- pip3 install -U .[testing]
- pip3 install -U .[test]
script:
- python3 --version
- pytest --verbose
Expand All @@ -37,18 +32,17 @@ macOS_task:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
install_script:
- brew install python3
- pip3 install -U .[testing]
- pip3 install -U .[test]
script:
- python3 --version
- pytest --verbose

FreeBSD_task:
alias: FreeBSD tests
freebsd_instance:
image_family: freebsd-12-3
image_family: freebsd-13-2
env:
matrix:
- PYTHON: 3.8
- PYTHON: 3.9
- PYTHON: 3.10
- PYTHON: 3.11
Expand All @@ -57,7 +51,7 @@ FreeBSD_task:
- pkg install -y python${PY} py${PY}-setuptools
- python${PYTHON} -m ensurepip --upgrade
- python${PYTHON} -m pip install -U 'pip>=19' # Hard requirement for no setup.py.
- python${PYTHON} -m pip install .[testing_only]
- python${PYTHON} -m pip install .[test]
script:
- python${PYTHON} --version
- pytest --verbose
Expand All @@ -68,7 +62,6 @@ Windows_task:
image: cirrusci/windowsservercore:2019
env:
matrix:
- PYTHON: 3.8.10
- PYTHON: 3.9.13
- PYTHON: 3.10.9
- PYTHON: 3.11.1
Expand All @@ -77,7 +70,7 @@ Windows_task:
- ps: Invoke-WebRequest -Uri https://www.python.org/ftp/python/${env:PYTHON}/python-${env:PYTHON}-amd64.exe -OutFile C:\python-installer.exe
- C:\python-installer.exe /quiet TargetDir=C:\Python SimpleInstall=1
install_script:
- C:\Python\python.exe -m pip install -e .[testing]
- C:\Python\python.exe -m pip install -e .[test]
version_info_script:
- C:\Python\python.exe --version
- C:\Python\python.exe -m pip --version
Expand Down Expand Up @@ -110,7 +103,7 @@ Release_task:
install_script:
- apt-get update
- apt-get install -y git
- pip3 install . .[testing]
- pip3 install . .[test]
build_script:
- bork clean
- bork build
Expand Down
1 change: 0 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jobs=1
# usually to register additional checkers.
load-plugins=pylint.extensions.check_elif,
pylint.extensions.comparetozero,
pylint.extensions.emptystring,
pylint.extensions.overlapping_exceptions,
pylint.extensions.redefined_variable_type,

Expand Down
10 changes: 2 additions & 8 deletions emanate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@
import sys
from .config import Config

try:
from importlib import metadata
except ImportError:
import importlib_metadata as metadata # type: ignore

# Set the module-level dunders suggested in PEP8
__author__ = metadata.metadata(__name__)['author']
__version__ = metadata.version(__name__)

__author__ = "Ellen Marie Dash"
from .version import __version__

@dataclass(frozen=True)
class FilePair:
Expand Down
4 changes: 4 additions & 0 deletions emanate/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file should only ever be modified to change the version.
# This will automatically prepare and create a release.

__version__ = "7.0.0"
58 changes: 55 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,62 @@
[build-system]
# Specify the required build system.
# Setuptools 40.9.0+ requirement is necessary to get rid of setup.py; see
# https://github.com/pypa/setuptools/pull/1675
requires = ["setuptools >= 40.9.0", "wheel"]
requires = ["setuptools >= 61", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "emanate"
dynamic = ["version"]
authors = [
{name = "Ellen Marie Dash", email = "[email protected]"},
]
description = "Symlink files from one directory to another, similary to Effuse and Stow."
readme = "README.md"
license = {text = "MIT"}
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

dependencies = []

requires-python = ">= 3.8"

[project.urls]
repository = "https://github.com/duckinator/emanate"
documentation = "https://emanate-docs.netlify.app/cli.html"

[project.optional-dependencies]
bork = [
"bork~=6.0.1",
]

test = [
".[bork]",
"pytest~=7.4",
"pylint~=3.0",
"pytest-pylint~=0.21.0",
"mypy~=1.6.1",
"pytest-mypy~=0.10.3",
]

docs = [
"pdoc3",
]

[project.scripts]
emanate = "emanate.cli:main"

[tool.setuptools]
packages = ["emanate"]

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

[tool.bork.zipapp]
enabled = true
main = "emanate.cli:main"
Expand Down
69 changes: 0 additions & 69 deletions setup.cfg

This file was deleted.

1 change: 0 additions & 1 deletion version

This file was deleted.

0 comments on commit ec8c059

Please sign in to comment.