File tree Expand file tree Collapse file tree 4 files changed +59
-5
lines changed Expand file tree Collapse file tree 4 files changed +59
-5
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,39 @@ jobs:
111111 user : __token__
112112 password : ${{ secrets.PYPI_TOKEN }}
113113
114+ publish-rsconnect :
115+ needs : test
116+ runs-on : ubuntu-latest
117+ steps :
118+ - uses : actions/checkout@v4
119+ with :
120+ fetch-depth : 0
121+ env :
122+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
123+ - uses : actions/setup-python@v4
124+ with :
125+ python-version : 3.8.x
126+ - name : Install uv # see scripts/temporary-rename
127+ uses : astral-sh/setup-uv@v5
128+ - run : pip install -e '.[test]'
129+ - run : pip freeze
130+ - run : make dist
131+ id : create_dist
132+ env :
133+ PACKAGE_NAME : rsconnect
134+ - uses : actions/upload-artifact@v4
135+ with :
136+ name : distributions
137+ path : dist/
138+ - run : pip install -vvv ${{ steps.create_dist.outputs.whl }}
139+ - run : rsconnect version
140+ - run : rsconnect --help
141+ - if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
142+ uses : pypa/gh-action-pypi-publish@release/v1
143+ with :
144+ user : __token__
145+ password : ${{ secrets.PYPI_TOKEN }}
146+
114147 docs :
115148 needs : test
116149 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ VERSION := $(shell python -m setuptools_scm)
22HOSTNAME := $(shell hostname)
33S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-python
44
5- BDIST_WHEEL := dist/rsconnect_python-$(VERSION ) -py2.py3-none-any.whl
5+ PACKAGE_NAME ?= rsconnect_python
6+ BDIST_WHEEL := dist/$(PACKAGE_NAME ) -$(VERSION ) -py2.py3-none-any.whl
67
78RUNNER = docker run \
89 -it --rm \
@@ -75,11 +76,12 @@ clean:
7576 ./build \
7677 ./dist \
7778 ./htmlcov \
78- ./rsconnect_python.egg-info
79+ ./rsconnect_python.egg-info \
80+ ./rsconnect.egg-info
7981
8082.PHONY : clean-stores
8183clean-stores :
82- @find . -name " rsconnect-python" | xargs rm -rf
84+ @find . -name " rsconnect-python" -o -name " rsconnect_python-* " -o -name " rsconnect-* " | xargs rm -rf
8385
8486.PHONY : shell
8587shell : RUNNER = bash -c
@@ -110,6 +112,7 @@ version:
110112# exported as a point of reference instead.
111113.PHONY : dist
112114dist :
115+ ./scripts/temporary-rename
113116 pip wheel --no-deps -w dist .
114117 twine check $(BDIST_WHEEL )
115118 rm -vf dist/* .egg
Original file line number Diff line number Diff line change 11[project ]
22name = " rsconnect_python"
3- description = " Python integration with Posit Connect"
3+ description = " The Posit Connect command-line interface. "
44
5- authors = [{ name = " Michael Marchetti " , email = " mike @posit.co" }]
5+ authors = [{ name = " Posit, PBC " , email = " rsconnect @posit.co" }]
66license = { file = " LICENSE.md" }
77readme = { file = " README.md" , content-type = " text/markdown" }
88requires-python = " >=3.8"
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env -S uv run --script
2+ # /// script
3+ # dependencies = ["toml"]
4+ # ///
5+ import os
6+
7+ import toml
8+
9+ if "PACKAGE_NAME" in os .environ :
10+
11+ with open ("pyproject.toml" , "r" ) as f :
12+ pyproject = toml .load (f )
13+
14+ # Override package name from pyproject.toml with environment variable
15+ pyproject ["project" ]["name" ] = os .environ ["PACKAGE_NAME" ]
16+
17+ with open ("pyproject.toml" , "w" ) as f :
18+ toml .dump (pyproject , f )
You can’t perform that action at this time.
0 commit comments