Skip to content

Commit

Permalink
ci: migrate setup.py to pyproject.toml (#294)
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <callahan.kovacs@canonical.com>
  • Loading branch information
mr-cal authored Jun 8, 2023
1 parent 163c1d7 commit 1d4f8ba
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 128 deletions.
16 changes: 0 additions & 16 deletions .bumpversion.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
sudo snap install --no-wait shellcheck
echo "::endgroup::"
echo "::group::pip install"
python -m pip install -U .[dev]
python -m pip install -U .[dev,lint,types]
echo "::endgroup::"
echo "::group::Wait for snap to complete"
snap watch --last=install
Expand Down
14 changes: 11 additions & 3 deletions craft_providers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2021 Canonical Ltd.
# Copyright 2021-2023 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -17,13 +17,21 @@

"""Craft Providers base package."""

__version__ = "1.13.0"

from .base import Base
from .errors import ProviderError
from .executor import Executor
from .provider import Provider

try:
from ._version import __version__
except ImportError: # pragma: no cover
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("craft_providers")
except PackageNotFoundError:
__version__ = "dev"

__all__ = [
"Base",
"Executor",
Expand Down
7 changes: 2 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2021 Canonical Ltd.
# Copyright 2021-2023 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -36,12 +36,9 @@
# -- Project information -----------------------------------------------------

project = "Craft Providers"
copyright = "2021, Canonical Ltd."
copyright = "2021-2023, Canonical Ltd."
author = "Canonical Ltd."

# The full version, including alpha/beta/rc tags
release = "1.13.0"


# -- General configuration ---------------------------------------------------

Expand Down
84 changes: 84 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
[project]
name = "craft-providers"
dynamic = ["version", "readme"]
dependencies = [
"pydantic",
"pyyaml",
"requests_unixsocket",
# Needed until requests-unixsocket supports urllib3 v2
# https://github.com/msabramo/requests-unixsocket/pull/69
"urllib3<2",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Natural Language :: English",
"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",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.8"

[project.scripts]
craft-providers = "craft_providers.cli:main"

[project.optional-dependencies]
dev = [
"twine",
"coverage",
"freezegun",
"logassert",
"pyfakefs",
"pytest",
"pytest-mock",
"pytest-subprocess",
"responses",
"types-requests",
"types-setuptools",
"types-pyyaml",
]
lint = [
"black",
"codespell",
"ruff==0.0.270",
"yamllint",
]
types = [
"mypy",
"pyright",
]
docs = [
"sphinx",
"sphinx-autodoc-typehints",
"sphinx-pydantic",
"sphinx-rtd-theme",
]

[build-system]
requires = [
"setuptools==67.7.2",
"setuptools_scm[toml]>=7.1"
]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
readme = {file = "README.md"}

[tool.setuptools_scm]
write_to = "craft_providers/_version.py"

[tool.setuptools.packages.find]
exclude = [
"dist",
"docs",
"results",
"tests",
]



[tool.distutils.bdist_wheel]
universal = true

Expand Down
103 changes: 0 additions & 103 deletions setup.py

This file was deleted.

0 comments on commit 1d4f8ba

Please sign in to comment.