Skip to content

Commit e5bade7

Browse files
authored
Merge pull request #816 from bashtage/attempt-dynamic-version
BLD: First attempt
2 parents 6e95d9a + b241eb2 commit e5bade7

File tree

3 files changed

+40
-26
lines changed

3 files changed

+40
-26
lines changed

azure-pipelines.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ variables:
1414
TEST_INSTALL: false
1515
MPLBACKEND: agg
1616
PYTEST_PATTERN: "(not slow)"
17-
coverage: true
1817
test.install: false
1918
pip.pre: false
2019

ci/azure/azure_template_posix.yml

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
# defaults for any parameters that are not specified
88
name: ''
99
vmImage: ''
10-
FLAGS: ''
10+
BUILD_FLAGS: ''
1111

1212

1313
jobs:
@@ -26,7 +26,7 @@ jobs:
2626
python.version: '3.11'
2727
python_310:
2828
python.version: '3.10'
29-
test.install: true
29+
test.wheel: true
3030
python_311_copy_on_write:
3131
python.version: '3.11'
3232
ARCH_TEST_COPY_ON_WRITE: 1
@@ -36,6 +36,7 @@ jobs:
3636
SCIPY: 1.9.0
3737
MATPLOTLIB: 3.4.0
3838
PANDAS: 1.4.0
39+
test.sdist: true
3940
python_310_conda_numba:
4041
python.version: '3.10'
4142
use.conda: 'true'
@@ -51,11 +52,11 @@ jobs:
5152
PANDAS: 1.4.0
5253
python_311_cython_coverage:
5354
python.version: '3.11'
54-
FLAGS: '-Csetup-args=-Dcython-coverage=true'
55+
BUILD_FLAGS: '-Csetup-args=-Dcython-coverage=true'
5556
cython.coverage: true
5657
python_311_no_binary:
5758
python.version: '3.11'
58-
FLAGS: '-Csetup-args=-Dno-binary=true'
59+
BUILD_FLAGS: '-Csetup-args=-Dno-binary=true'
5960
PYTEST_OPTS: '--skip-slow'
6061
PANDAS: 2.2.2
6162
USE_NUMBA: true
@@ -75,7 +76,6 @@ jobs:
7576
python_312_statsmodels_main:
7677
python.version: '3.10'
7778
STATSMODELS_MAIN: true
78-
coverage: false
7979
python312_pre:
8080
python.version: '3.12'
8181
pip.pre: true
@@ -127,19 +127,30 @@ jobs:
127127
displayName: 'List Configuration (conda)'
128128
condition: eq(variables['use.conda'], 'true')
129129
130+
131+
- script: |
132+
echo "Installing to site packages (sdist)"
133+
python -m pip install pip build --upgrade
134+
python -m build --sdist . -v
135+
SDIST=$(ls -t ./dist/arch-*.tar.gz | head -1)
136+
pip install ${SDIST} -v
137+
displayName: 'Install arch (site-packages, sdist)'
138+
condition: eq(variables['test.sdist'], 'true')
139+
130140
- script: |
131-
echo "Installing to site packages"
132-
python -m pip wheel -v . --wheel-dir ./dist/
141+
echo "Installing to site packages (wheel)
142+
python -m pip install pip wheel --upgrade"
143+
python -m pip wheel . --wheel-dir ./dist/
133144
WHL=$(ls -t ./dist/arch-*.whl | head -1)
134-
pip install ${WHL}
135-
displayName: 'Install arch (site-packages)'
136-
condition: eq(variables['test.install'], 'true')
145+
pip install ${WHL} -v
146+
displayName: 'Install arch (site-packages, wheel)'
147+
condition: eq(variables['test.wheel'], 'true')
137148
138149
- script: |
139-
echo python -m pip install --no-build-isolation -vv -e . ${FLAGS}
140-
python -m pip install --no-build-isolation -vv -e . ${FLAGS}
150+
echo python -m pip install --no-build-isolation -vv -e . ${BUILD_FLAGS}
151+
python -m pip install --no-build-isolation -vv -e . ${BUILD_FLAGS}
141152
displayName: 'Install arch (editable)'
142-
condition: ne(variables['test.install'], 'true')
153+
condition: and(ne(variables['test.wheel'], 'true'), ne(variables['test.sdist'], 'true'))
143154
144155
- script: |
145156
pushd arch/univariate
@@ -152,28 +163,27 @@ jobs:
152163
condition: eq(variables['cython.coverage'], 'true')
153164
154165
- script: |
155-
set -e
156166
echo "Testing site packages"
157167
mkdir test_run_dir
158168
pushd test_run_dir
159169
python -c "import arch; arch.test(['-n', 'auto', '--junitxml=../junit/test-results.xml'])"
160170
popd
161171
displayName: 'Run tests (site-packages)'
162-
condition: eq(variables['test.install'], 'true')
172+
condition: or(eq(variables['test.wheel'], 'true'), eq(variables['test.sdist'], 'true'))
163173
164174
- script: |
165175
echo "Testing editable install"
166-
export COVERAGE_OPTS="--cov=arch --cov-report xml:coverage.xml --cov-report term"
167-
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
168-
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
176+
export COVERAGE_OPTS="--cov-config=.coveragerc --cov=arch --cov-branch --cov-report xml:coverage.xml --cov-report term"
177+
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} arch/tests
178+
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} arch/tests
169179
displayName: 'Run tests (editable)'
170-
condition: and(ne(variables['test.install'], 'true'), ne(variables['pip.pre'], 'true'))
180+
condition: and(and(ne(variables['test.wheel'], 'true'), ne(variables['test.sdist'], 'true')), ne(variables['pip.pre'], 'true'))
171181
172182
- script: |
173183
echo "Testing pip-pre"
174-
export COVERAGE_OPTS="--cov=arch --cov-report xml:coverage.xml --cov-report term"
175-
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
176-
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
184+
export COVERAGE_OPTS="--cov-config=.coveragerc --cov=arch --cov-branch --cov-report xml:coverage.xml --cov-report term"
185+
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} arch/tests
186+
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} arch/tests
177187
displayName: 'Run tests (pip pre)'
178188
condition: eq(variables['pip.pre'], 'true')
179189
continueOnError: true
@@ -187,11 +197,11 @@ jobs:
187197
- task: PublishCodeCoverageResults@2
188198
inputs:
189199
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
190-
condition: and(eq(variables['coverage'], 'true'), ne(variables['test.install'], 'true'))
200+
condition: and(ne(variables['test.sdist'], 'true'), ne(variables['test.wheel'], 'true'))
191201

192202
- script: |
193203
curl -Os https://uploader.codecov.io/latest/linux/codecov
194204
chmod +x codecov
195205
./codecov -f coverage.xml -F adder -F subtractor
196206
displayName: 'Codecov upload'
197-
condition: and(eq(variables['coverage'], 'true'), ne(variables['test.install'], 'true'))
207+
condition: and(ne(variables['test.sdist'], 'true'), ne(variables['test.wheel'], 'true'))

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ classifiers = [
3535
"Topic :: Scientific/Engineering",
3636
]
3737
description = "ARCH for Python"
38-
version = "8.0.0dev0"
38+
dynamic = [
39+
'version'
40+
]
3941
keywords = [
4042
"arch",
4143
"ARCH",
@@ -144,6 +146,9 @@ changelog = "https://bashtage.github.io/arch/changes.html"
144146
[tool.meson-python.args]
145147
setup = ['--vsenv']
146148

149+
[tool.setuptools_scm]
150+
version_file = "arch/_version.py"
151+
147152
[tool.black]
148153
target-version = ['py310', 'py311', 'py312', 'py313']
149154
exclude = '''

0 commit comments

Comments
 (0)