Skip to content

Commit c949636

Browse files
committed
update build/test framework, drop py<=3.6
1 parent f7156b9 commit c949636

File tree

8 files changed

+150
-157
lines changed

8 files changed

+150
-157
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ repos:
4545
- flake8-comprehensions
4646
- flake8-debugger
4747
- flake8-isort
48+
- flake8-pyproject
4849
- flake8-string-format
4950
- repo: https://github.com/google/yapf
5051
rev: v0.43.0

LICENCE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
* files: *
2-
MPLv2.0 2015-2023 (c) Casper da Costa-Luis
2+
MPLv2.0 2015-2025 (c) Casper da Costa-Luis
33
[casperdcl](https://github.com/casperdcl).
44

55

Makefile

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# IMPORTANT: for compatibility with `python setup.py make [alias]`, ensure:
1+
# IMPORTANT: for compatibility with `python -m pymake [alias]`, ensure:
22
# 1. Every alias is preceded by @[+]make (eg: @make alias)
33
# 2. A maximum of one @make alias or command per line
44
# see: https://github.com/tqdm/py-make/issues/1
@@ -8,7 +8,7 @@
88
all
99
flake8
1010
test
11-
testnose
11+
pytest
1212
testsetup
1313
testcoverage
1414
testtimer
@@ -17,15 +17,16 @@
1717
prebuildclean
1818
clean
1919
toxclean
20-
installdev
20+
install_build
21+
install_dev
2122
install
2223
build
2324
buildupload
2425
pypi
2526
none
2627

2728
help:
28-
@python setup.py make -p
29+
@python -m pymake -p
2930

3031
alltests:
3132
@+make testcoverage
@@ -37,24 +38,23 @@ all:
3738
@+make build
3839

3940
flake8:
40-
@+flake8 -j 8 --count --statistics --exit-zero .
41+
@+pre-commit run -a flake8
4142

4243
test:
4344
tox --skip-missing-interpreters -p all
4445

45-
testnose:
46-
nosetests -d -v tests/
46+
pytest:
47+
pytest
4748

4849
testsetup:
49-
python setup.py check --metadata --restructuredtext --strict
50-
python setup.py make none
50+
@make help
5151

5252
testcoverage:
5353
@make coverclean
54-
nosetests --with-coverage --cover-package=argopt --cover-erase --cover-min-percentage=80 -d -v tests/
54+
pytest --cov=argopt --cov-report=xml --cov-report=term --cov-fail-under=80
5555

5656
testtimer:
57-
nosetests --with-timer -d -v tests/
57+
pytest
5858

5959
distclean:
6060
@+make coverclean
@@ -79,22 +79,21 @@ clean:
7979
toxclean:
8080
@+python -c "import shutil; shutil.rmtree('.tox', True)"
8181

82-
83-
installdev:
84-
python setup.py develop --uninstall
85-
python setup.py develop
86-
8782
install:
88-
python setup.py install
83+
python -m pip install .
84+
install_dev:
85+
python -m pip install -e .
86+
install_build:
87+
python -m pip install -r .meta/requirements-build.txt
8988

9089
build:
9190
@make prebuildclean
9291
@make testsetup
93-
python setup.py sdist bdist_wheel
94-
# python setup.py bdist_wininst
92+
python -m build
93+
python -m twine check dist/*
9594

9695
pypi:
97-
twine upload dist/*
96+
python -m twine upload dist/*
9897

9998
buildupload:
10099
@make build

argopt/_argopt.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function
2-
31
import logging
42
import re
53
from argparse import ArgumentParser, RawDescriptionHelpFormatter

pyproject.toml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,124 @@ build-backend = "setuptools.build_meta"
55
[tool.setuptools_scm]
66
write_to = "argopt/_dist_ver.py"
77
write_to_template = "__version__ = '{version}'\n"
8+
# py>3.7:
9+
# version_file = "argopt/_dist_ver.py"
10+
# version_file_template = "__version__ = '{version}'\n"
11+
12+
[tool.setuptools.packages.find]
13+
exclude = ["tests"]
14+
15+
[project.urls]
16+
repository = "https://github.com/casperdcl/argopt"
17+
changelog = "https://github.com/casperdcl/argopt/releases"
18+
19+
[project]
20+
name = "argopt"
21+
dynamic = ["version"]
22+
authors = [{name = "Casper da Costa-Luis", email = "[email protected]"}]
23+
description = "doc to argparse driven by docopt"
24+
readme = "README.rst"
25+
requires-python = ">=3.7"
26+
keywords = ["docopt", "argparse", "doc", "docstring", "commandline", "argument", "option", "optional", "parameter", "positional", "console", "terminal", "command line", "CLI", "UI", "gui", "gooey"]
27+
license = {text = "MPL-2.0"}
28+
# Trove classifiers (https://pypi.org/pypi?%3Aaction=list_classifiers)
29+
classifiers = [
30+
"Development Status :: 5 - Production/Stable",
31+
"Environment :: Console",
32+
"Environment :: MacOS X",
33+
"Environment :: Other Environment",
34+
"Environment :: Win32 (MS Windows)",
35+
"Environment :: X11 Applications",
36+
"Framework :: IPython",
37+
"Intended Audience :: Developers",
38+
"Intended Audience :: Education",
39+
"Intended Audience :: End Users/Desktop",
40+
"Intended Audience :: Other Audience",
41+
"Intended Audience :: System Administrators",
42+
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
43+
"Operating System :: MacOS",
44+
"Operating System :: MacOS :: MacOS X",
45+
"Operating System :: Microsoft",
46+
"Operating System :: Microsoft :: MS-DOS",
47+
"Operating System :: Microsoft :: Windows",
48+
"Operating System :: POSIX",
49+
"Operating System :: POSIX :: BSD",
50+
"Operating System :: POSIX :: BSD :: FreeBSD",
51+
"Operating System :: POSIX :: Linux",
52+
"Operating System :: POSIX :: SunOS/Solaris",
53+
"Operating System :: Unix",
54+
"Programming Language :: Python",
55+
"Programming Language :: Python :: 3",
56+
"Programming Language :: Python :: 3.7",
57+
"Programming Language :: Python :: 3.8",
58+
"Programming Language :: Python :: 3.9",
59+
"Programming Language :: Python :: 3.10",
60+
"Programming Language :: Python :: 3.11",
61+
"Programming Language :: Python :: 3.12",
62+
"Programming Language :: Python :: 3 :: Only",
63+
"Programming Language :: Python :: Implementation",
64+
"Programming Language :: Python :: Implementation :: IronPython",
65+
"Programming Language :: Python :: Implementation :: PyPy",
66+
"Programming Language :: Unix Shell",
67+
"Topic :: Desktop Environment",
68+
"Topic :: Education :: Computer Aided Instruction (CAI)",
69+
"Topic :: Education :: Testing",
70+
"Topic :: Office/Business",
71+
"Topic :: Other/Nonlisted Topic",
72+
"Topic :: Software Development :: Build Tools",
73+
"Topic :: Software Development :: Libraries",
74+
"Topic :: Software Development :: Libraries :: Python Modules",
75+
"Topic :: Software Development :: Pre-processors",
76+
"Topic :: Software Development :: User Interfaces",
77+
"Topic :: System :: Installation/Setup",
78+
"Topic :: System :: Logging",
79+
"Topic :: System :: Monitoring",
80+
"Topic :: System :: Shells",
81+
"Topic :: Terminals",
82+
"Topic :: Utilities"]
83+
dependencies = [
84+
"argopt>=0.3.5",
85+
'importlib_resources; python_version < "3.9"',
86+
"tabulate",
87+
"tqdm>=4.44.0"]
88+
89+
[project.optional-dependencies]
90+
dev = ["pytest>=6", "pytest-cov", "pytest-timeout", "pytest-xdist"]
91+
92+
[project.scripts]
93+
git-fame = "gitfame:main"
94+
95+
[tool.flake8]
96+
max_line_length = 99
97+
extend_ignore = ["E261"]
98+
exclude = [".git", "__pycache__", "build", "dist", ".eggs", ".tox"]
99+
100+
[tool.yapf]
101+
spaces_before_comment = [15, 20]
102+
arithmetic_precedence_indication = true
103+
allow_split_before_dict_value = false
104+
coalesce_brackets = true
105+
column_limit = 99
106+
each_dict_entry_on_separate_line = false
107+
space_between_ending_comma_and_closing_bracket = false
108+
split_before_named_assigns = false
109+
split_before_closing_bracket = false
110+
blank_line_before_nested_class_or_def = false
111+
112+
[tool.isort]
113+
line_length = 99
114+
known_first_party = ["argopt", "tests"]
115+
116+
[tool.pytest.ini_options]
117+
timeout = 30
118+
log_level = "INFO"
119+
python_files = ["tests_*.py"]
120+
testpaths = ["tests"]
121+
addopts = "-v --tb=short -rxs -W=error --durations=0 --durations-min=0.1"
122+
123+
[tool.coverage.run]
124+
branch = true
125+
omit = ["argopt/_docopt.py"]
126+
relative_files = true
127+
[tool.coverage.report]
128+
show_missing = true

setup.cfg

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

tests/tests_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import unicode_literals
2-
31
from argopt import _utils
42

53

0 commit comments

Comments
 (0)