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 project to use pyproject.toml (#236) #247

Merged
merged 2 commits into from
Apr 23, 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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Update pip and install dev requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install '.[dev]'

- name: Test
run: tox
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include *.rst
include pyproject.toml
include requirements-dev.txt
include Makefile
include LICENSE
include .readthedocs.yaml
Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,3 @@ docs: ## Runs cog and builds Sphinx docs
make -C docs/ clean
make -C docs/ doctest
make -C docs/ html

.PHONY: checkrot
checkrot: ## Check package rot for dev dependencies
python -m venv ./tmpvenv/
./tmpvenv/bin/pip install -U pip
./tmpvenv/bin/pip install -r requirements-dev.txt
./tmpvenv/bin/pip list -o
rm -rf ./tmpvenv/
6 changes: 1 addition & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ Run::

Some configuration environments require additional dependencies::


# For INI support
$ pip install 'everett[ini]'

# for YAML support
$ pip install 'everett[yaml]'

Additionally, if you want to use the Sphinx extension to document
your configuration, you need to add Sphinx::

# to use the Sphinx extension
$ pip install 'everett[sphinx]'

Quick start
===========
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# The short X.Y version.
version = everett.__version__
# The full version with the release date.
release = everett.__version__ + " " + everett.__releasedate__
release = everett.__version__

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
Expand Down
2 changes: 1 addition & 1 deletion docs/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ Create and activate a virtualenvironment::

Install Everett and dev requirements into virtual environment::

$ pip install -r requirements-dev.txt
$ pip install -e '.[dev,ini,yaml,sphinx]'
87 changes: 73 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,76 @@
[project]
name = "everett"
description = "Configuration library for Python applications"
version = "3.3.0"
readme = "README.rst"
keywords = ["conf", "config", "configuration", "ini", "env", "yaml"]
authors = [{name = "Will Kahn-Greene"}]
license = {text = "MPLv2"}
requires-python = ">=3.8"
dependencies = []
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"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 :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules",
]
urls.Homepage = "https://everett.readthedocs.io/"
urls.Source = "https://github.com/willkg/everett/"
urls.Issues = "https://github.com/willkg/everett/issues"

[project.optional-dependencies]
sphinx = [
"sphinx",
]
ini = [
"configobj",
]
yaml = [
"PyYAML",
]
dev = [
"check-manifest",
"cogapp",
"mypy",
"pytest",
"ruff",
"tox",
"tox-gh-actions",
"twine",
"types-PyYAML",
"Sphinx==7.2.6; python_version > '3.8'",
"Sphinx==6.2.1; python_version <= '3.8'",
"sphinx_rtd_theme",
]


[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"


[tool.ruff]
target-version = "py38"
src = ["src"]
line-length = 88

[tool.ruff.lint]
# Enable pycodestyle (E), pyflakes (F), and bugbear (B) rules
select = ["E", "F", "B"]

# Ignore line length violations
line-length = 88
# Ignore line length violations; ruff format does its best and we can rely on
# that
ignore = ["E501"]

target-version = "py38"

src = ["src"]

[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"


Expand Down Expand Up @@ -43,13 +103,13 @@ legacy_tox_ini = """
[tox]
envlist =
py38
py38-doctest
py38-lint
py38-typecheck
py39
py310
py311
py312
py38-doctest
py38-lint
py38-typecheck

[gh-actions]
python =
Expand All @@ -60,19 +120,18 @@ python =
3.12: py312

[testenv]
deps = -rrequirements-dev.txt
extras = dev,ini,sphinx,yaml
commands = pytest {posargs} tests/

[testenv:py38-doctest]
deps = -rrequirements-dev.txt
commands = pytest --doctest-modules src/

[testenv:py38-lint]
basepython = python3.8
changedir = {toxinidir}
commands =
ruff format --check setup.py tests docs examples
ruff check src setup.py tests docs examples
ruff format --check tests docs examples
ruff check src tests docs examples

[testenv:py38-typecheck]
basepython = python3.8
Expand Down
16 changes: 0 additions & 16 deletions requirements-dev.txt

This file was deleted.

70 changes: 0 additions & 70 deletions setup.py

This file was deleted.

15 changes: 8 additions & 7 deletions src/everett/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

"""Everett is a Python library for configuration."""

from importlib.metadata import (
version as importlib_version,
PackageNotFoundError,
)
from typing import Callable, List, Union


__author__ = "Will Kahn-Greene"
__email__ = "[email protected]"

# yyyymmdd
__releasedate__ = "20231106"
# x.y.z or x.y.z.dev0
__version__ = "3.3.0"
try:
__version__ = importlib_version("everett")
except PackageNotFoundError:
__version__ = "unknown"


__all__ = [
Expand Down