Skip to content

Commit 1677110

Browse files
authored
refactor(geoarrow-pandas,geoarrow-pyarrow): Use package-specific setup for setuptools_scm (#53)
1 parent f015c48 commit 1677110

File tree

12 files changed

+42
-2
lines changed

12 files changed

+42
-2
lines changed

.github/workflows/docs.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
1720
- uses: r-lib/actions/setup-pandoc@v2
1821

1922
- name: Set up Python

.github/workflows/test.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
2121

2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
2426

2527
- name: Set up Python ${{ matrix.python-version }}
2628
uses: actions/setup-python@v4

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Generated version files
2+
_version.py
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]

geoarrow-pandas/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ build-backend = "setuptools.build_meta"
4141

4242
[tool.setuptools_scm]
4343
root = ".."
44+
tag_regex = "geoarrow-pandas-([0-9.]+)"
45+
git_describe_command = "git describe --long --match='geoarrow-pandas-*'"
46+
version_file = "src/geoarrow/pandas/_version.py"
4447

4548
[tool.pytest.ini_options]
4649
consider_namespace_packages = true

geoarrow-pandas/src/geoarrow/pandas/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
>>> import geoarrow.pandas as _
1010
"""
1111

12+
from geoarrow.types._version import __version__, __version_tuple__ # NOQA: F401
13+
1214
from .lib import (
1315
GeoArrowAccessor,
1416
GeoArrowExtensionDtype,

geoarrow-pandas/tests/test_geoarrow_pandas.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import re
2+
13
import pytest
24

35
import pandas as pd
@@ -8,6 +10,10 @@
810
import numpy as np
911

1012

13+
def test_version():
14+
assert re.match(r"^[0-9]+\.[0-9]+", gapd.__version__)
15+
16+
1117
def test_dtype_constructor():
1218
from_pyarrow = gapd.GeoArrowExtensionDtype(ga.point())
1319
assert from_pyarrow.name == "geoarrow.point"

geoarrow-pyarrow/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ build-backend = "setuptools.build_meta"
4141

4242
[tool.setuptools_scm]
4343
root = ".."
44+
tag_regex = "geoarrow-pyarrow-([0-9]+.[0-9]+.[0-9]+)"
45+
git_describe_command = "git describe --long --match='geoarrow-pyarrow-*'"
46+
version_file = "src/geoarrow/pyarrow/_version.py"
4447

4548
[tool.pytest.ini_options]
4649
consider_namespace_packages = true

geoarrow-pyarrow/src/geoarrow/pyarrow/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
>>> import geoarrow.pyarrow as ga
88
"""
99

10+
from geoarrow.types._version import __version__, __version_tuple__ # NOQA: F401
11+
1012
from geoarrow.c.lib import GeometryType, Dimensions, CoordType, EdgeType, CrsType
1113

1214
from geoarrow.pyarrow._type import (

geoarrow-pyarrow/tests/test_pyarrow.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
import json
3+
import re
34
from math import inf
45

56
import pyarrow as pa
@@ -12,6 +13,10 @@
1213
import geoarrow.pyarrow._array as _array
1314

1415

16+
def test_version():
17+
assert re.match(r"^[0-9]+\.[0-9]+", ga.__version__)
18+
19+
1520
def test_geometry_type_basic():
1621
ctype = lib.CVectorType.Make(
1722
ga.GeometryType.POINT, ga.Dimensions.XY, ga.CoordType.SEPARATE

geoarrow-types/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ build-backend = "setuptools.build_meta"
4242
[tool.setuptools_scm]
4343
root = ".."
4444
tag_regex = "geoarrow-types-([0-9.]+)"
45+
git_describe_command = "git describe --long --match='geoarrow-types-*'"
46+
version_file = "src/geoarrow/types/_version.py"
4547

4648
[tool.pytest.ini_options]
4749
consider_namespace_packages = true

0 commit comments

Comments
 (0)