Skip to content

Commit 2aef772

Browse files
committed
chg: dev: rename module, refactor package metadata, move to src layout
Signed-off-by: Steve Arnold <sarnold@vctlabs.com>
1 parent aa3414d commit 2aef772

26 files changed

+114
-141
lines changed

pyproject.toml

Lines changed: 77 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,98 @@ requires = [
55
]
66
build-backend = "setuptools.build_meta"
77

8+
[project]
9+
name = "bmaptool"
10+
description = "BMAP tools"
11+
dynamic = ["version"]
12+
dependencies = [
13+
"defusedxml",
14+
"gpg >= 1.10.0",
15+
'importlib-metadata>=4.6; python_version < "3.10"',
16+
]
17+
requires-python = ">=3.8"
18+
authors = [
19+
{name = "Joshua Watt", email = "JPEWhacker@gmail.com"},
20+
{name = "Trevor Woerner", email = "twoerner@gmail.com"},
21+
{name = "Tim Orling", email = "ticotimo@gmail.com"},
22+
23+
]
24+
readme = "README.md"
25+
classifiers = [
26+
"Development Status :: 5 - Production/Stable",
27+
"Intended Audience :: Developers",
28+
"Topic :: Software Development :: Build Tools",
29+
"Topic :: Software Development :: Embedded Systems",
30+
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
31+
"Programming Language :: Python :: 3",
32+
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
35+
"Programming Language :: Python :: 3.11",
36+
"Programming Language :: Python :: 3.12",
37+
]
38+
39+
[project.optional-dependencies]
40+
dev = [
41+
"black >= 22.3.0",
42+
"six >= 1.16.0",
43+
]
44+
cov = [
45+
"coverage",
46+
"coverage_python_version",
47+
]
48+
doc = [
49+
"sphinx",
50+
"sphinx_git",
51+
"recommonmark",
52+
"sphinx_rtd_theme",
53+
"sphinxcontrib-apidoc",
54+
]
55+
test = [
56+
"pytest",
57+
"pytest-cov",
58+
]
59+
60+
[project.urls]
61+
Homepage = "https://github.com/yoctoproject/bmaptool"
62+
Repository = "https://github.com/yoctoproject/bmaptool.git"
63+
Issues = "https://github.com/yoctoproject/bmaptool/issues"
64+
Changelog = "https://github.com/yoctoproject/bmaptool/blob/master/CHANGELOG.md"
65+
66+
[project.scripts]
67+
bmaptool = "bmaptool.CLI:main"
68+
869
[tool.setuptools_scm]
970

1071
[tool.pytest.ini_options]
1172
minversion = "6.0"
12-
testpaths = ["tests",]
13-
log_cli = true
73+
testpaths = ["tests", "src/bmaptool",]
74+
log_cli = false
1475
doctest_optionflags = ["ELLIPSIS", "NORMALIZE_WHITESPACE",]
15-
addopts = "--strict-markers"
76+
addopts = "-ra -q -p no:warnings"
1677
markers = "subscript"
1778

1879
[tool.coverage.run]
1980
branch = true
20-
include = ["bmaptools/"]
21-
source = [
22-
"bmaptools",
23-
".tox/py*/lib/python*/site-packages/",
24-
]
25-
omit = [
26-
"docs",
27-
"tests",
28-
".tox",
29-
]
81+
source = ["src/bmaptool"]
82+
plugins = ["coverage_python_version"]
3083

3184
[tool.coverage.paths]
32-
source = ["bmaptools"]
85+
source = [
86+
"src/",
87+
"*/site-packages"
88+
]
3389

3490
[tool.coverage.report]
3591
fail_under = 40
3692
show_missing = true
93+
exclude_lines = [
94+
"pragma: no cover",
95+
"raise NotImplementedError",
96+
"raise AssertionError",
97+
"if typing.TYPE_CHECKING:",
98+
"if TYPE_CHECKING:",
99+
]
37100

38101
[tool.black]
39102
line-length = 90

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defusedxml
2-
six
32
gpg
43
# dev tasks
4+
six
55
pytest
66
pytest-cov
77
pylint

setup.cfg

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

setup.py

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
# pylint: disable=R0902,R0903
4949

5050
import hashlib
51-
from bmaptools.BmapHelpers import human_size
52-
from bmaptools import Filemap
51+
from bmaptool.BmapHelpers import human_size
52+
from bmaptool import Filemap
5353

5454
# The bmap format version we generate.
5555
#

bmaptools/CLI.py renamed to src/bmaptool/CLI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
else:
4949
from importlib.metadata import version
5050

51-
VERSION = version('bmaptools')
51+
VERSION = version('bmaptool')
5252

5353
log = logging.getLogger() # pylint: disable=C0103
5454

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import fcntl
3535
import tempfile
3636
import logging
37-
from bmaptools import BmapHelpers
37+
from bmaptool import BmapHelpers
3838

3939
_log = logging.getLogger(__name__) # pylint: disable=C0103
4040

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import subprocess
3535
import netrc
3636
from six.moves.urllib import parse as urlparse
37-
from bmaptools import BmapHelpers
37+
from bmaptool import BmapHelpers
3838

3939
_log = logging.getLogger(__name__) # pylint: disable=C0103
4040

0 commit comments

Comments
 (0)