Skip to content

Commit b3d32a0

Browse files
committed
Add project.script to launch the doctest runner.
1 parent 49fca59 commit b3d32a0

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ test = ["pytest"]
3636
[project.urls]
3737
Repository = "https://github.com/GeospatialPython/pyshp"
3838

39+
[project.scripts]
40+
shapefile="__init__:main"
41+
3942
[tool.hatch.build.targets.sdist]
4043
only-include = ["src", "shapefiles", "test_shapefile.py"]
4144

src/shapefile/__init__.py

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@
1313

1414
from .__version__ import __version__
1515
from ._doctest_runner import _test
16+
from .classes import Field, ShapeRecord, ShapeRecords, Shapes
17+
from .constants import (
18+
MULTIPATCH,
19+
MULTIPOINT,
20+
MULTIPOINTM,
21+
MULTIPOINTZ,
22+
NULL,
23+
POINT,
24+
POINTM,
25+
POINTZ,
26+
POLYGON,
27+
POLYGONM,
28+
POLYGONZ,
29+
POLYLINE,
30+
POLYLINEM,
31+
POLYLINEZ,
32+
REPLACE_REMOTE_URLS_WITH_LOCALHOST,
33+
SHAPETYPE_LOOKUP,
34+
)
35+
from .exceptions import GeoJSON_Error, RingSamplingError, ShapefileException
36+
from .geometric_calculations import bbox_overlap
1637
from .helpers import _Array, fsdecode_if_pathlike
1738
from .reader import Reader
1839
from .shapes import (
@@ -65,10 +86,28 @@
6586
WriteSeekableBinStream,
6687
ZBox,
6788
)
89+
from .writer import Writer
6890

6991
__all__ = [
7092
"__version__",
93+
"NULL",
94+
"POINT",
95+
"POLYLINE",
96+
"POLYGON",
97+
"MULTIPOINT",
98+
"POINTZ",
99+
"POLYLINEZ",
100+
"POLYGONZ",
101+
"MULTIPOINTZ",
102+
"POINTM",
103+
"POLYLINEM",
104+
"POLYGONM",
105+
"MULTIPOINTM",
106+
"MULTIPATCH",
107+
"SHAPETYPE_LOOKUP",
108+
"REPLACE_REMOTE_URLS_WITH_LOCALHOST",
71109
"Reader",
110+
"Writer",
72111
"fsdecode_if_pathlike",
73112
"_Array",
74113
"Shape",
@@ -117,6 +156,14 @@
117156
"FIELD_TYPE_ALIASES",
118157
"RecordValueNotDate",
119158
"RecordValue",
159+
"ShapefileException",
160+
"RingSamplingError",
161+
"GeoJSON_Error",
162+
"Field",
163+
"Shapes",
164+
"ShapeRecord",
165+
"ShapeRecords",
166+
"bbox_overlap",
120167
]
121168

122169
logger = logging.getLogger(__name__)
@@ -131,5 +178,3 @@ def main() -> None:
131178
sys.exit(failure_count)
132179

133180

134-
if __name__ == "__main__":
135-
main()

0 commit comments

Comments
 (0)