Skip to content

Commit c5e32bb

Browse files
committed
Merge branch 'setup' into develop
2 parents cab2f65 + cc3d38b commit c5e32bb

File tree

11 files changed

+279
-121
lines changed

11 files changed

+279
-121
lines changed

.github/requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
distutils-pytest
2+
git-props
13
pathlib ; python_version == '2.7'
24
pytest >=3.7.0
3-
setuptools_scm
5+
setuptools
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish
2+
on:
3+
release:
4+
types:
5+
- published
6+
jobs:
7+
PyPI:
8+
name: publish release to PyPI
9+
runs-on: ubuntu-latest
10+
environment: release
11+
permissions:
12+
id-token: write
13+
env:
14+
SDIST: pytest-dependency-${{ github.event.release.tag_name }}.tar.gz
15+
steps:
16+
- name: Fetch assets
17+
uses: cb80/dlassets@latest
18+
with:
19+
tag: ${{ github.event.release.tag_name }}
20+
to: assets
21+
- name: Check assets
22+
run: |
23+
ls -la assets
24+
- name: Copy distfile to dist directory
25+
run: |
26+
mkdir -p dist
27+
cp -p assets/$SDIST dist
28+
- name: Upload distfile to PyPI
29+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run-tests.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,28 @@ jobs:
66
strategy:
77
matrix:
88
python-version:
9-
- '2.7'
10-
- '3.5'
11-
- '3.6'
129
- '3.7'
1310
- '3.8'
1411
- '3.9'
1512
- '3.10'
13+
- '3.11'
14+
- '3.12'
1615
os: [ubuntu-latest]
16+
include:
17+
- python-version: '3.6'
18+
os: ubuntu-20.04
1719
steps:
1820
- name: Check out repository code
19-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
2022
with:
2123
fetch-depth: 0
2224
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
25+
uses: actions/setup-python@v4
2426
with:
2527
python-version: ${{ matrix.python-version }}
2628
- name: Install dependencies
2729
run: |
2830
pip install -r .github/requirements.txt
29-
- name: Build
30-
run: |
31-
python setup.py build
3231
- name: Test with pytest
3332
run: |
34-
export PYTHONPATH=$(pwd)/build/lib
35-
python -m pytest tests
33+
python setup.py test

.gitignore

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
*.pyc
2-
*~
3-
.cache/
41
__pycache__/
5-
/.version
2+
/.env
63
/MANIFEST
4+
/_meta.py
75
/build/
86
/dist/
9-
/doc/doctest/
10-
/doc/doctrees/
11-
/doc/html/
12-
/doc/latex/
13-
/doc/linkcheck/
14-
/pytest_dependency.egg-info/
15-
/python2_6.patch

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
include .version
21
include LICENSE.txt
32
include MANIFEST.in
43
include README.rst
4+
include _meta.py
55
include doc/examples/*.py
66
include tests/conftest.py
77
include tests/pytest.ini

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ BUILDLIB = $(CURDIR)/build/lib
55
build:
66
$(PYTHON) setup.py build
77

8-
test: build
9-
PYTHONPATH=$(BUILDLIB) $(PYTHON) -m pytest tests
8+
test:
9+
$(PYTHON) setup.py test
1010

1111
sdist:
1212
$(PYTHON) setup.py sdist
@@ -15,16 +15,17 @@ doc-html: build
1515
$(MAKE) -C doc html PYTHONPATH=$(BUILDLIB)
1616

1717
clean:
18-
rm -f *~ tests/*~
1918
rm -rf build
19+
rm -rf __pycache__
2020

2121
distclean: clean
22-
rm -rf .cache tests/.cache .pytest_cache tests/.pytest_cache
23-
rm -f *.pyc tests/*.pyc
24-
rm -rf __pycache__ tests/__pycache__
25-
rm -f MANIFEST .version
22+
rm -f MANIFEST _meta.py
2623
rm -rf dist
27-
rm -rf pytest_dependency.egg-info
24+
rm -rf tests/.pytest_cache
2825
$(MAKE) -C doc distclean
2926

30-
.PHONY: build test sdist doc-html clean distclean
27+
meta:
28+
$(PYTHON) setup.py meta
29+
30+
31+
.PHONY: build test sdist doc-html clean distclean meta

README.rst

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,23 @@ The latest release version can be found `at PyPI`__.
3131
System requirements
3232
-------------------
3333

34-
+ Python 2.7 or 3.4 and newer.
34+
+ Python 3.4 and newer.
3535
+ `setuptools`_.
3636
+ `pytest`_ 3.7.0 or newer.
3737

3838
Optional library packages:
3939

40-
+ `setuptools_scm`_
40+
+ `git-props`_
4141

42-
The version number is managed using this package. All source
43-
distributions add a static text file with the version number and
44-
fall back using that if `setuptools_scm` is not available. So this
45-
package is only needed to build out of the plain development source
46-
tree as cloned from GitHub.
42+
This package is used to extract some metadata such as the version
43+
number out of git, the version control system. All releases embed
44+
that metadata in the distribution. So this package is only needed
45+
to build out of the plain development source tree as cloned from
46+
GitHub, but not to build a release distribution.
47+
48+
+ `distutils-pytest`_ >= 0.2
49+
50+
Only needed to run the test suite.
4751

4852

4953
Installation
@@ -57,7 +61,7 @@ Installation
5761

5862
3. Test (optional)::
5963

60-
$ PYTHONPATH=build/lib python -m pytest tests
64+
$ python setup.py test
6165

6266
4. Install::
6367

@@ -101,5 +105,6 @@ permissions and limitations under the License.
101105
.. _PyPI site: https://pypi.org/project/pytest-dependency/
102106
.. _setuptools: http://pypi.python.org/pypi/setuptools/
103107
.. _pytest: http://pytest.org/
104-
.. _setuptools_scm: https://github.com/pypa/setuptools_scm/
108+
.. _git-props: https://github.com/RKrahl/git-props
109+
.. _distutils-pytest: https://github.com/RKrahl/distutils-pytest
105110
.. _Read the Docs site: https://pytest-dependency.readthedocs.io/

doc/.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/devhelp/
2+
/dirhtml/
3+
/doctrees/
4+
/epub/
5+
/gettext/
6+
/html/
7+
/htmlhelp/
8+
/json/
9+
/latex/
10+
/linkcheck/
11+
/man/
12+
/pickle/
13+
/pseudoxml/
14+
/qthelp/
15+
/singlehtml/
16+
/texinfo/
17+
/text/
18+
/xml/

doc/src/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@ History of changes to pytest-dependency
22
=======================================
33

44
dev (not yet released)
5+
Incompatible changes
6+
+ Drop support for Python 2.
7+
58
Bug fixes and minor changes
69
+ `#40`_: add logging.
710
+ `#50`_, `#51`_: test suite incompatibility with pytest 6.2.0.
811
+ `#58`_: declare the type of automark_dependency ini-option
912
correctly as bool.
1013

14+
Internal
15+
+ `#75`_: review build tool chain.
16+
1117
.. _#40: https://github.com/RKrahl/pytest-dependency/issues/40
1218
.. _#50: https://github.com/RKrahl/pytest-dependency/issues/50
1319
.. _#51: https://github.com/RKrahl/pytest-dependency/pull/51
1420
.. _#58: https://github.com/RKrahl/pytest-dependency/pull/58
21+
.. _#75: https://github.com/RKrahl/pytest-dependency/pull/75
1522

1623
0.5.1 (2020-02-14)
1724
Bug fixes and minor changes

python-pytest-dependency.spec

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
%bcond_without tests
2+
%global distname pytest-dependency
3+
4+
%if 0%{?sle_version} >= 150500
5+
%global pythons python3 python311
6+
%else
7+
%{?!python_module:%define python_module() python3-%{**}}
8+
%define skip_python2 1
9+
%endif
10+
11+
Name: python-%{distname}
12+
Version: $version
13+
Release: 0
14+
Summary: $description
15+
License: Apache-2.0
16+
URL: $url
17+
Group: Development/Languages/Python
18+
Source: https://github.com/RKrahl/pytest-dependency/releases/download/%{version}/%{distname}-%{version}.tar.gz
19+
BuildRequires: %{python_module base >= 3.4}
20+
BuildRequires: %{python_module setuptools}
21+
BuildRequires: fdupes
22+
BuildRequires: python-rpm-macros
23+
%if %{with tests}
24+
BuildRequires: %{python_module distutils-pytest}
25+
BuildRequires: %{python_module pytest >= 3.7}
26+
%endif
27+
Requires: python-pytest >= 3.7
28+
BuildArch: noarch
29+
%python_subpackages
30+
31+
%description
32+
$long_description
33+
34+
35+
%prep
36+
%setup -q -n %{distname}-%{version}
37+
38+
39+
%build
40+
%python_build
41+
42+
43+
%install
44+
%python_install
45+
%fdupes %{buildroot}%{python_sitelib}
46+
47+
48+
%if %{with tests}
49+
%check
50+
%python_expand $$python setup.py test
51+
%endif
52+
53+
54+
%files %{python_files}
55+
%license LICENSE.txt
56+
%doc README.rst
57+
%{python_sitelib}/*
58+
59+
60+
%changelog

0 commit comments

Comments
 (0)