aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2022-09-18 20:23:27 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2022-09-18 20:32:20 +0300
commitd45221ee39ea474bda4df54865d67b2d7eac229e (patch)
tree1985fd6fb84b08b406cc0f3fec96833dc5a3e044
parentversion: fix env for traversal (diff)
downloadsnakeoil-d45221ee39ea474bda4df54865d67b2d7eac229e.tar.gz
snakeoil-d45221ee39ea474bda4df54865d67b2d7eac229e.tar.bz2
snakeoil-d45221ee39ea474bda4df54865d67b2d7eac229e.zip
move to flit & makefile
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--.github/workflows/doc.yml8
-rw-r--r--.github/workflows/release.yml14
-rw-r--r--.github/workflows/test.yml9
-rw-r--r--MANIFEST.in7
-rw-r--r--Makefile25
-rw-r--r--pyproject.toml48
-rw-r--r--requirements/ci.txt1
-rw-r--r--requirements/dev.txt1
-rw-r--r--requirements/dist.txt4
-rw-r--r--requirements/docs.txt3
-rw-r--r--requirements/install.txt1
-rw-r--r--requirements/pyproject.toml3
-rw-r--r--requirements/test.txt1
-rw-r--r--requirements/tox.txt3
-rw-r--r--setup.cfg10
-rwxr-xr-xsetup.py31
16 files changed, 81 insertions, 88 deletions
diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
index 6d87487..53eee2c 100644
--- a/.github/workflows/doc.yml
+++ b/.github/workflows/doc.yml
@@ -16,18 +16,16 @@ jobs:
with:
python-version: '3.10'
cache: 'pip'
- cache-dependency-path: |
- requirements/dev.txt
- requirements/docs.txt
+ cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install -r requirements/dev.txt -r requirements/docs.txt
+ pip install .[doc]
- name: Build sphinx documentation
run: |
- python setup.py build_html
+ make html
# notify github this isn't a jekyll site
touch build/sphinx/html/.nojekyll
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b8ffb0c..b0d82dc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -17,30 +17,26 @@ jobs:
with:
python-version: "3.10"
cache: 'pip'
- cache-dependency-path: |
- requirements/dist.txt
- requirements/test.txt
+ cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install -r requirements/dist.txt -r requirements/test.txt
+ pip install build .[test]
- name: Test with pytest
env:
PY_COLORS: 1 # forcibly enable pytest colors
- run: python setup.py test
+ run: pytest
- name: Build sdist
run: |
git clean -fxd
# build sdist
- python setup.py sdist
- # run in-place build so wheel deps use release versions
- python setup.py build_py -i
+ make sdist
- name: Build wheel
- run: python setup.py bdist_wheel
+ run: make wheel
- name: Output dist file info
run: |
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index fab3095..b512934 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -33,21 +33,18 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- cache-dependency-path: |
- requirements/test.txt
- requirements/ci.txt
+ cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
- pip install -r requirements/test.txt -r requirements/ci.txt
- pip install .
+ pip install .[test]
- name: Test with pytest
env:
PY_COLORS: 1 # forcibly enable pytest colors
run: |
- pytest --cov --cov-report=term --cov-report=xml -v
+ pytest --cov --cov-report=term --cov-report=xml
- name: Submit code coverage to codecov
if: ${{ matrix.os == 'ubuntu-latest' }}
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 79380ce..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,7 +0,0 @@
-include LICENSE *.py *.rst tox.ini pyproject.toml .coveragerc
-recursive-include doc *
-recursive-include include/snakeoil *.h
-recursive-include requirements *.txt
-recursive-include src/snakeoil *.pyx *.c
-recursive-include tests *
-global-exclude *.pyc *.pyo __pycache__
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2ff7e76
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+PYTHON ?= python
+
+SPHINX_BUILD ?= sphinx-build
+SPHINX_BUILD_SOURCE_DIR ?= doc
+SPHINX_BUILD_BUILD_DIR ?= build/sphinx
+
+.PHONY: man
+man:
+ $(SPHINX_BUILD) -a -b man $(SPHINX_BUILD_SOURCE_DIR) $(SPHINX_BUILD_BUILD_DIR)/man
+
+.PHONY: html
+html:
+ $(SPHINX_BUILD) -a -b html $(SPHINX_BUILD_SOURCE_DIR) $(SPHINX_BUILD_BUILD_DIR)/html
+
+.PHONY: sdist
+sdist:
+ $(PYTHON) -m build --sdist
+
+.PHONY: wheel
+wheel:
+ $(PYTHON) -m build --wheel
+
+.PHONY: clean
+clean:
+ $(RM) -r build/sphinx doc/api
diff --git a/pyproject.toml b/pyproject.toml
index 34cb6b5..47ece45 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,8 +1,50 @@
[build-system]
-requires = ["setuptools", "wheel"]
-build-backend = "setuptools.build_meta"
+requires = ["flit_core >=3.7,<4"]
+build-backend = "flit_core.buildapi"
+
+[project]
+name = "snakeoil"
+description = "misc common functionality and useful optimizations"
+readme = "README.rst"
+requires-python = "~=3.8"
+authors = [
+ {name = "Tim Harder", email = "radhermit@gmail.com"},
+ {name = "Arthur Zamarin", email = "arthurzam@gentoo.org"},
+]
+maintainers = [
+ {name = "Arthur Zamarin", email = "arthurzam@gentoo.org"},
+]
+classifiers = [
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: BSD License",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+]
+dynamic = ["version"]
+
+dependencies = [
+ "lazy-object-proxy",
+]
+
+[project.optional-dependencies]
+test = [
+ "pytest >=6.0",
+ "pytest-cov",
+]
+doc = ["sphinx"]
+
+[project.urls]
+Homepage = "https://github.com/pkgcore/snakeoil"
+Documentation = "https://pkgcore.github.io/snakeoil/"
+Source = "https://github.com/pkgcore/snakeoil"
+
+[tool.flit.sdist]
+include = ["doc", "tox.ini", "tests", "Makefile", "NEWS.rst"]
+exclude = [".github/", ".gitignore", "doc/api/", "tests/__pycache__", "tests/cli/__pycache__"]
[tool.pytest.ini_options]
minversion = "6.0"
-addopts = "-ra"
+addopts = "-vv -ra -l"
testpaths = ["tests"]
diff --git a/requirements/ci.txt b/requirements/ci.txt
deleted file mode 100644
index c75c448..0000000
--- a/requirements/ci.txt
+++ /dev/null
@@ -1 +0,0 @@
-pytest-cov
diff --git a/requirements/dev.txt b/requirements/dev.txt
deleted file mode 100644
index 9caf6fa..0000000
--- a/requirements/dev.txt
+++ /dev/null
@@ -1 +0,0 @@
-lazy-object-proxy
diff --git a/requirements/dist.txt b/requirements/dist.txt
deleted file mode 100644
index ec03116..0000000
--- a/requirements/dist.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-# deps for building sdist/wheels for pypi
--r install.txt
--r docs.txt
-wheel
diff --git a/requirements/docs.txt b/requirements/docs.txt
deleted file mode 100644
index 67848fc..0000000
--- a/requirements/docs.txt
+++ /dev/null
@@ -1,3 +0,0 @@
--r install.txt
-
-sphinx
diff --git a/requirements/install.txt b/requirements/install.txt
deleted file mode 100644
index 9caf6fa..0000000
--- a/requirements/install.txt
+++ /dev/null
@@ -1 +0,0 @@
-lazy-object-proxy
diff --git a/requirements/pyproject.toml b/requirements/pyproject.toml
deleted file mode 100644
index 9787c3b..0000000
--- a/requirements/pyproject.toml
+++ /dev/null
@@ -1,3 +0,0 @@
-[build-system]
-requires = ["setuptools", "wheel"]
-build-backend = "setuptools.build_meta"
diff --git a/requirements/test.txt b/requirements/test.txt
deleted file mode 100644
index e079f8a..0000000
--- a/requirements/test.txt
+++ /dev/null
@@ -1 +0,0 @@
-pytest
diff --git a/requirements/tox.txt b/requirements/tox.txt
deleted file mode 100644
index 4e49649..0000000
--- a/requirements/tox.txt
+++ /dev/null
@@ -1,3 +0,0 @@
--r dev.txt
--r test.txt
--r ci.txt
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 446d836..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,10 +0,0 @@
-[aliases]
-build_html = build_sphinx -b html
-
-[build_sphinx]
-source-dir = doc
-build-dir = build/sphinx
-all_files = 1
-
-[tool:pytest]
-testpaths = tests
diff --git a/setup.py b/setup.py
deleted file mode 100755
index 9aae713..0000000
--- a/setup.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import sys
-
-from setuptools import setup
-
-# ignore system-installed snakeoil if it exists
-sys.path.insert(0, os.path.abspath('src'))
-from snakeoil.dist import distutils_extensions as pkgdist
-pkgdist_setup, pkgdist_cmds = pkgdist.setup()
-
-
-setup(**dict(
- pkgdist_setup,
- description='misc common functionality and useful optimizations',
- url='https://github.com/pkgcore/snakeoil',
- license='BSD',
- author='Tim Harder',
- author_email='radhermit@gmail.com',
- cmdclass=dict(
- pkgdist_cmds,
- ),
- classifiers=[
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: BSD License',
- 'Programming Language :: Python :: 3.8',
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
- ],
-))