Skip to content

Commit d9f644d

Browse files
authored
Jac/release automation (#1613)
* update publish workflow * Update pyproject.toml and setup * add init files to find test_repr, fix it to pass
1 parent 6f525ff commit d9f644d

File tree

14 files changed

+73
-99
lines changed

14 files changed

+73
-99
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
tableauserverclient/_version.py export-subst
2+
tableauserverclient/bin/_version.py export-subst

.github/workflows/publish-pypi.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Publish to PyPi
22

3-
# This will publish a package to TestPyPi (and real Pypi if run on master) with a version
4-
# number generated by versioneer from the most recent tag looking like v____
5-
# TODO: maybe move this into the package job so all release-based actions are together
3+
# This will build a package with a version set by versioneer from the most recent tag matching v____
4+
# It will publish to TestPyPi, and to real Pypi *if* run on master where head has a release tag
5+
# For a live run, this should only need to be triggered by a newly published repo release.
6+
# This can also be run manually for testing
67
on:
8+
release:
9+
types: [published]
710
workflow_dispatch:
811
push:
912
tags:
@@ -23,7 +26,7 @@ jobs:
2326
- name: Build dist files
2427
run: |
2528
python -m pip install --upgrade pip
26-
pip install -e .[test] build
29+
python -m pip install -e .[test] build
2730
python -m build
2831
git describe --tag --dirty --always
2932

MANIFEST.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ include CONTRIBUTORS.md
44
include LICENSE
55
include LICENSE.versioneer
66
include README.md
7-
include tableauserverclient/_version.py
8-
include versioneer.py
97
recursive-include docs *.md
108
recursive-include samples *.py
119
recursive-include samples *.txt
@@ -18,5 +16,4 @@ recursive-include test *.png
1816
recursive-include test *.py
1917
recursive-include test *.xml
2018
recursive-include test *.tde
21-
global-include *.pyi
2219
global-include *.typed

publish.sh

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

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=75.0", "versioneer[toml]==0.29", "wheel"]
2+
requires = ["setuptools>=77.0", "versioneer[toml]==0.29", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
@@ -8,7 +8,7 @@ name="tableauserverclient"
88
dynamic = ["version"]
99
description='A Python module for working with the Tableau Server REST API.'
1010
authors = [{name="Tableau", email="github@tableau.com"}]
11-
license = {file = "LICENSE"}
11+
license-files = ["LICENSE"]
1212
readme = "README.md"
1313

1414
dependencies = [
@@ -34,6 +34,13 @@ repository = "https://github.com/tableau/server-client-python"
3434
[project.optional-dependencies]
3535
test = ["black==24.10", "build", "mypy==1.4", "pytest>=7.0", "pytest-cov", "pytest-subtests",
3636
"pytest-xdist", "requests-mock>=1.0,<2.0", "types-requests>=2.32.4.20250913"]
37+
38+
[tool.setuptools.packages.find]
39+
where = ["tableauserverclient", "tableauserverclient.helpers", "tableauserverclient.models", "tableauserverclient.server", "tableauserverclient.server.endpoint"]
40+
41+
[tool.setuptools.dynamic]
42+
version = {attr = "versioneer.get_version"}
43+
3744
[tool.black]
3845
line-length = 120
3946
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
@@ -60,5 +67,5 @@ addopts = "--junitxml=./test.junit.xml"
6067
VCS = "git"
6168
style = "pep440-pre"
6269
versionfile_source = "tableauserverclient/bin/_version.py"
63-
versionfile_build = "tableauserverclient/bin/_version.py"
70+
versionfile_build = "_version.py"
6471
tag_prefix = "v"

setup.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,7 @@
22
from setuptools import setup
33

44
setup(
5-
version=versioneer.get_version(),
6-
cmdclass=versioneer.get_cmdclass(),
7-
# not yet sure how to move this to pyproject.toml
8-
packages=[
9-
"tableauserverclient",
10-
"tableauserverclient.helpers",
11-
"tableauserverclient.models",
12-
"tableauserverclient.server",
13-
"tableauserverclient.server.endpoint",
14-
],
5+
# This line is required to set the version number when building the wheel
6+
# not yet sure how to move this to pyproject.toml - it may require work in versioneer
7+
cmdclass=versioneer.get_cmdclass()
158
)

tableauserverclient/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,3 @@
148148
"WeeklyInterval",
149149
"WorkbookItem",
150150
]
151-
152-
from .bin import _version
153-
154-
__version__ = _version.get_versions()["version"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# generated during initial setup of versioneer
2+
from . import _version
3+
__version__ = _version.get_versions()['version']

tableauserverclient/bin/_version.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@ class VersioneerConfig:
4646

4747
def get_config() -> VersioneerConfig:
4848
"""Create, populate and return the VersioneerConfig() object."""
49-
# these strings are filled in when 'setup.py versioneer' creates
50-
# _version.py
49+
# these strings are filled in from pyproject.toml at file generation time
5150
cfg = VersioneerConfig()
5251
cfg.VCS = "git"
5352
cfg.style = "pep440-pre"
5453
cfg.tag_prefix = "v"
5554
cfg.parentdir_prefix = "None"
56-
cfg.versionfile_source = "tableauserverclient/_version.py"
55+
cfg.versionfile_source = "tableauserverclient/bin/_version.py"
5756
cfg.verbose = False
5857
return cfg
5958

test/http/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)