Skip to content

Commit 27dd5ec

Browse files
committed
build backend: use custom wrapper around flit
For pkgcore we need to run multiple preparations of generating files before creating sdist or wheel. Flit is a very simple and nice build backend, much more than setuptools. Also migrate to use snakeoil.dist sphinx extension for generating man and html, to remove various logic from `doc/conf.py`. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
1 parent ee0e2cb commit 27dd5ec

27 files changed

Lines changed: 152 additions & 370 deletions

File tree

.github/workflows/doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
- name: Install dependencies
3030
run: |
3131
python -m pip install --upgrade pip
32-
pip install -r requirements/dev.txt -r requirements/docs.txt
32+
pip install ".[doc]"
3333
3434
- name: Build sphinx documentation
3535
run: |
36-
python setup.py build_docs
36+
make html
3737
# notify github this isn't a jekyll site
3838
touch build/sphinx/html/.nojekyll
3939

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches: [deploy]
66
tags: [v*]
7+
workflow_dispatch:
78

89
jobs:
910
build-and-deploy:
@@ -15,26 +16,26 @@ jobs:
1516
- name: Set up Python 3.10
1617
uses: actions/setup-python@v4
1718
with:
18-
python-version: '3.10'
19+
python-version: "3.10"
1920

2021
- name: Install dependencies
2122
run: |
22-
# install deps required for building sdist/wheels
2323
python -m pip install --upgrade pip
24-
pip install -r requirements/dist.txt -r requirements/test.txt
24+
pip install build ".[test,doc]"
2525
2626
- name: Test with pytest
2727
env:
2828
PY_COLORS: 1 # forcibly enable pytest colors
29-
run: python setup.py test
29+
run: pytest
3030

3131
- name: Build sdist
3232
run: |
3333
git clean -fxd
34-
python setup.py sdist
34+
make man
35+
make sdist
3536
3637
- name: Build wheel
37-
run: python setup.py bdist_wheel
38+
run: make wheel
3839

3940
- name: Output dist file info
4041
run: |
@@ -52,8 +53,7 @@ jobs:
5253
TWINE_USERNAME: __token__
5354
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
5455
if: startsWith(github.ref, 'refs/tags/')
55-
run: |
56-
twine upload dist/*
56+
run: twine upload dist/*
5757

5858
- name: Create GitHub release
5959
uses: softprops/action-gh-release@v1

.github/workflows/test.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest]
16-
python-version: ['3.8', '3.9', '3.10']
16+
python-version: ['3.9', '3.10', '3.11']
1717
experimental: [false]
1818
include:
19-
- os: ubuntu-latest
20-
python-version: '3.11.0-beta - 3.11'
21-
experimental: true
19+
# - os: ubuntu-latest
20+
# python-version: '3.11.0-beta - 3.11'
21+
# experimental: true
2222
- os: macos-latest
2323
python-version: '3.10'
2424
experimental: false
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
python-version: ${{ matrix.python-version }}
3535
cache: 'pip'
36-
cache-dependency-path: requirements/*.txt
36+
cache-dependency-path: pyproject.toml
3737

3838
# experimental targets generally lack lxml wheels
3939
- name: Install libxml2 and libxslt development packages
@@ -48,11 +48,10 @@ jobs:
4848
# enable gnu-sed usage as "sed"
4949
echo "/usr/local/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
5050
51-
- name: Install deps
51+
- name: Install dependencies
5252
run: |
5353
python -m pip install --upgrade pip
54-
pip install -r requirements/test.txt -r requirements/ci.txt
55-
pip install .
54+
pip install ".[test]"
5655
5756
- name: Test with pytest
5857
env:
@@ -80,7 +79,7 @@ jobs:
8079
- name: Install dependencies
8180
run: |
8281
python -m pip install --upgrade pip
83-
pip install -r requirements/dev.txt pylint
82+
pip install . pylint
8483
8584
- name: Run linting tools
8685
run: |

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021, pkgdev contributors
1+
Copyright (c) 2021-2022, pkgdev contributors
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

MANIFEST.in

Lines changed: 0 additions & 10 deletions
This file was deleted.

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
PYTHON ?= python
2+
SPHINX_BUILD ?= $(PYTHON) -m sphinx.cmd.build
3+
4+
.PHONY: man html
5+
man html:
6+
$(SPHINX_BUILD) -a -b $@ doc build/sphinx/$@
7+
8+
.PHONY: sdist wheel
9+
sdist wheel:
10+
$(PYTHON) -m build --$@
11+
12+
.PHONY: clean
13+
clean:
14+
$(RM) -r build/sphinx doc/api doc/generated doc/_build dist

README.rst

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,7 @@ Installing from git::
3737

3838
Installing from a tarball::
3939

40-
python setup.py install
41-
42-
Tests
43-
=====
44-
45-
A standalone test runner is integrated in setup.py::
46-
47-
python setup.py test
48-
49-
In addition, a tox config is provided so the testsuite can be run in a
50-
virtualenv setup against all supported python versions. To run tests for all
51-
environments just execute **tox** in the root directory of a repo or unpacked
52-
tarball. Otherwise, for a specific python version execute something similar to
53-
the following::
54-
55-
tox -e py39
40+
pip install .
5641

5742

5843
.. _pkgcheck: https://github.com/pkgcore/pkgcheck

bin/pkgdev

Lines changed: 0 additions & 1 deletion
This file was deleted.

completion/bash/pkgdev renamed to data/share/bash-completion/completions/pkgdev

File renamed without changes.

0 commit comments

Comments
 (0)