Skip to content

Commit 4cfbdf5

Browse files
authored
Merge branch 'master' into sagerb-handle-pip-notices
2 parents a7c5e1a + b6cbcbc commit 4cfbdf5

File tree

25 files changed

+214
-180
lines changed

25 files changed

+214
-180
lines changed

.flake8

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

.github/workflows/main.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,19 @@ jobs:
2626
runs-on: ${{ matrix.os }}
2727
name: test (py${{ matrix.python-version }} ${{ matrix.os }})
2828
steps:
29-
- uses: actions/checkout@v2
30-
- run: git fetch --prune --unshallow
29+
- uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3134
- uses: actions/setup-python@v2
3235
with:
3336
python-version: ${{ matrix.python-version }}
34-
- run: pip install -r requirements.txt
37+
- run: pip install '.[test]'
3538
- run: pip freeze
3639
- run: make fmt
3740
- run: make lint
38-
- run: python setup.py --version
41+
- run: rsconnect version
3942
- run: make test-${{ matrix.python-version }}
4043
- if: github.event_name == 'pull_request' && matrix.python-version == '3.8'
4144
uses: orgoro/coverage@v3
@@ -47,28 +50,34 @@ jobs:
4750
runs-on: ubuntu-latest
4851
continue-on-error: true
4952
steps:
50-
- uses: actions/checkout@v2
51-
- run: git fetch --prune --unshallow
53+
- uses: actions/checkout@v4
54+
with:
55+
fetch-depth: 0
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5258
- uses: actions/setup-python@v2
5359
with:
5460
python-version: 3.8.x
55-
- run: pip install --pre -r requirements.txt
61+
- run: pip install --pre '.[test]'
5662
- run: pip freeze
5763
- run: make fmt
5864
- run: make lint
59-
- run: python setup.py --version
65+
- run: rsconnect version
6066
- run: make mock-test-3.8
6167

6268
distributions:
6369
needs: test
6470
runs-on: ubuntu-latest
6571
steps:
66-
- uses: actions/checkout@v2
67-
- run: git fetch --prune --unshallow
72+
- uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 0
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6877
- uses: actions/setup-python@v2
6978
with:
7079
python-version: 3.8.x
71-
- run: pip install -r requirements.txt
80+
- run: pip install -e '.[test]'
7281
- run: pip freeze
7382
- run: make dist
7483
id: create_dist
@@ -117,12 +126,14 @@ jobs:
117126
needs: test
118127
runs-on: ubuntu-latest
119128
steps:
120-
- uses: actions/checkout@v2
121-
- run: git fetch --prune --unshallow
129+
- uses: actions/checkout@v4
130+
with:
131+
fetch-depth: 0
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122134
- uses: actions/setup-python@v2
123135
with:
124136
python-version: 3.8.x
125-
- run: pip install -r requirements.txt
126137
- run: pip freeze
127138
- run: make docs
128139
- uses: actions/upload-artifact@v2
@@ -163,15 +174,15 @@ jobs:
163174
name: "Integration tests against latest Connect"
164175
runs-on: ubuntu-latest
165176
steps:
166-
- uses: actions/checkout@v2
177+
- uses: actions/checkout@v4
167178
- uses: actions/setup-python@v2
168179
with:
169180
python-version: 3.8
170181
- name: Install dependencies
171182
run: |
172183
python -m pip install --upgrade pip
173-
python -m pip install -r requirements.txt
174184
python -m pip install -r vetiver-testing/vetiver-requirements.txt
185+
python -m pip install '.[test]'
175186
- name: Run RStudio Connect
176187
run: |
177188
docker-compose up --build -d
@@ -197,7 +208,9 @@ jobs:
197208
CONNECT_LICENSE: ${{ secrets.RSC_LICENSE }}
198209
ADMIN_API_KEY: ${{ secrets.ADMIN_API_KEY }}
199210
steps:
200-
- uses: actions/checkout@v2
211+
- uses: actions/checkout@v4
212+
with:
213+
fetch-depth: 0
201214
env:
202215
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203216
- uses: extractions/setup-just@v1

.github/workflows/snyk.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,5 @@ jobs:
4242
4343
- uses: snyk/actions/setup@master
4444

45-
- name: Run Snyk (setup.py)
46-
run: snyk monitor --file="setup.py" --package-manager=pip --project-name="setup.py" --org=${{ env.SNYK_ORG }}
47-
4845
- name: Run Snyk (requirements.txt)
4946
run: snyk monitor --file="requirements.txt" --package-manager=pip --project-name="requirements.txt" --org=${{ env.SNYK_ORG }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/rsconnect-build-test
2323
/rsconnect/version.py
2424
/tests/testdata/**/rsconnect-python/
25+
env
2526
htmlcov
2627
test-home/
2728
venv

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
67
## Unreleased
78

89
### Fixed
@@ -27,10 +28,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2728
recognized filename patterns, the file patterns `app-*.py`, `app_*.py`, `*-app.py`,
2829
and `*_app.py` are now considered. However, if the directory contains more than
2930
one file matching these new patterns, you must provide rsconnect-python with an
30-
explicit `--entrypoint` argument.
31+
explicit `--entrypoint` argument.\
3132
- Added a new verbose logging level. Specifying `-v` on the command line uses this
3233
new level. Currently this will cause filenames to be logged as they are added to
3334
a bundle. To enable maximum verbosity (debug level), use `-vv`.
35+
- Added the `deploy flask` command.
36+
- Added the `write-manifest flask` command.
3437

3538
### Changed
3639
- Removing experimental support for Conda. Connect does not support restoring Conda environments.

CONTRIBUTING.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ cd rsconnect-python
2222
python3 -m venv .venv
2323
# Activate the virtual environment
2424
source .venv/bin/activate
25-
# install our requirements into the virtual environment
26-
pip install -r requirements.txt
27-
# install rsconnect-python with a symbolic link to the locations repository,
28-
# meaning any changes to code in there will automatically be reflected
29-
pip install -e ./
25+
# Install rsconnect-python with a symbolic link to the locations repository,
26+
# meaning any changes to code in there will automatically be reflected.
27+
# Also install dev/test dependencies.
28+
pip install -e '.[test]'
3029
```
3130

3231
## Workflow
@@ -46,8 +45,8 @@ make test
4645
make all-tests
4746
```
4847

49-
As another example, the [`test` job in the default GitHub Actions workflow](.github/workflows/main.yml)
50-
uses some of these targets during the CI for building and testing.
48+
As another example, the [`test` job in the default GitHub Actions workflow](.github/workflows/main.yml)
49+
uses some of these targets during the CI for building and testing.
5150

5251
## Proposing Change
5352

@@ -82,7 +81,7 @@ a release will be created and published to the repository
8281

8382
rsconnect-python exists on conda-forge as its own [feedstock](https://github.com/conda-forge/rsconnect-python-feedstock)
8483

85-
Updating the package requires a fork of the repository and a [push request](https://github.com/conda-forge/rsconnect-python-feedstock#updating-rsconnect-python-feedstock).
84+
Updating the package requires a fork of the repository and a [push request](https://github.com/conda-forge/rsconnect-python-feedstock#updating-rsconnect-python-feedstock).
8685

8786
- For new version/release, update the [meta.yaml](https://github.com/conda-forge/rsconnect-python-feedstock/blob/master/recipe/meta.yaml) file with the new version number, source url, and corresponding checksum.
8887

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ FROM ${BASE_IMAGE}
33

44
WORKDIR /rsconnect
55
COPY scripts/build-image build-image
6-
COPY requirements.txt requirements.txt
76
RUN bash build-image && rm -vf build-image

Makefile

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION := $(shell python setup.py --version)
1+
VERSION := $(shell python -m setuptools_scm)
22
HOSTNAME := $(shell hostname)
33
S3_PREFIX := s3://rstudio-connect-downloads/connect/rsconnect-python
44

@@ -67,13 +67,6 @@ fmt-%:
6767
@echo ERROR: This python version cannot run the fmting tools
6868
@exit 1
6969

70-
.PHONY: deps-prerelease
71-
deps-prerelease:
72-
pip install --pre -r requirements.txt
73-
74-
deps-%:
75-
$(RUNNER) 'pip install --pre -r requirements.txt'
76-
7770
lint-%:
7871
$(RUNNER) 'black --check --diff rsconnect/'
7972
$(RUNNER) 'flake8 rsconnect/'
@@ -112,10 +105,6 @@ test: test-3.8
112105
lint: RUNNER = bash -c
113106
lint: lint-3.8
114107

115-
.PHONY: deps
116-
deps: RUNNER = bash -c
117-
deps: deps-3.8
118-
119108
.PHONY: fmt
120109
fmt: RUNNER = bash -c
121110
fmt: fmt-3.8
@@ -133,12 +122,16 @@ version:
133122
# exported as a point of reference instead.
134123
.PHONY: dist
135124
dist:
136-
python setup.py bdist_wheel
125+
pip wheel --no-deps -w dist .
137126
twine check $(BDIST_WHEEL)
138127
rm -vf dist/*.egg
139128
@echo "::set-output name=whl::$(BDIST_WHEEL)"
140129
@echo "::set-output name=whl_basename::$(notdir $(BDIST_WHEEL))"
141130

131+
.PHONY: dist-install
132+
dist-install: dist
133+
pip install $(BDIST_WHEEL)
134+
142135
.PHONY: sync-to-s3
143136
sync-to-s3:
144137
aws s3 cp --acl bucket-owner-full-control \

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You may also build and install a wheel directly from a repository clone:
4242
git clone https://github.com/rstudio/rsconnect-python.git
4343
cd rsconnect-python
4444
pip install pipenv
45-
make deps dist
45+
make dist
4646
pip install ./dist/rsconnect_python-*.whl
4747
```
4848

@@ -117,7 +117,7 @@ you will need to include the `--cacert` option that points to your certificate
117117
authority (CA) trusted certificates file. Both of these options can be saved along
118118
with the URL and API Key for a server.
119119

120-
> **Note**
120+
> **Note**
121121
> When certificate information is saved for the server, the specified file
122122
> is read and its _contents_ are saved under the server's nickname. If the CA file's
123123
> contents are ever changed, you will need to add the server information again.
@@ -135,7 +135,7 @@ rsconnect add \
135135
--name myserver
136136
```
137137

138-
> **Note**
138+
> **Note**
139139
> The `rsconnect` CLI will verify that the serve URL and API key
140140
> are valid. If either is found not to be, no information will be saved.
141141
@@ -270,8 +270,9 @@ rsconnect write-manifest notebook my-notebook.ipynb
270270
You can deploy a variety of APIs and applications using sub-commands of the
271271
`rsconnect deploy` command.
272272

273-
* `api`: WSGI-compliant APIs such as Flask and packages based on Flask
274-
* `fastapi`: ASGI-compliant APIs (FastAPI, Quart, Sanic, and Falcon)
273+
* `api`: WSGI-compliant APIs (e.g., `bottle`, `falcon`, `flask`, `flask-restx`, `flasgger`, `pycnic`).
274+
* `flask`: Flask APIs (_Note: `flask` is an alias of `api`._).
275+
* `fastapi`: ASGI-compliant APIs (e.g, `fastapi`, `quart`, `sanic`, `starlette`)
275276
* `dash`: Python Dash apps
276277
* `streamlit`: Streamlit apps
277278
* `bokeh`: Bokeh server apps
@@ -430,7 +431,7 @@ filename referenced in the manifest.
430431

431432
### Environment variables
432433
You can set environment variables during deployment. Their names and values will be
433-
passed to Posit Connect during deployment so you can use them in your code. Note that
434+
passed to Posit Connect during deployment so you can use them in your code. Note that
434435
if you are using `rsconnect` to deploy to shinyapps.io, environment variable management
435436
is not supported on that platform.
436437

@@ -985,9 +986,9 @@ xargs printf -- '-g %s\n' < guids.txt | xargs rsconnect content build add
985986
```
986987
## Programmatic Provisioning
987988
988-
Posit Connect supports the programmatic bootstrapping of an administrator API key
989+
Posit Connect supports the programmatic bootstrapping of an administrator API key
989990
for scripted provisioning tasks. This process is supported by the `rsconnect bootstrap` command,
990-
which uses a JSON Web Token to request an initial API key from a fresh Connect instance.
991+
which uses a JSON Web Token to request an initial API key from a fresh Connect instance.
991992
992993
> **Warning**
993994
> This feature **requires Python version 3.6 or higher**.
@@ -998,7 +999,7 @@ rsconnect bootstrap \
998999
--jwt-keypath /path/to/secret.key
9991000
```
10001001
1001-
A full description on how to use `rsconnect bootstrap` in a provisioning workflow is provided in the Connect administrator guide's
1002+
A full description on how to use `rsconnect bootstrap` in a provisioning workflow is provided in the Connect administrator guide's
10021003
[programmatic provisioning](https://docs.posit.co/connect/admin/programmatic-provisioning) documentation.
10031004
10041005
## Server Administration Tasks

docs/docs/css/custom.css

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88

99
.md-header {
10-
border-bottom: 1px solid rgba(0, 0, 0, 0.15) !important;
10+
border-bottom: 1px solid rgba(0, 0, 0, 0.15) !important;
1111
}
1212

1313
@media only screen and (max-width: 76.1875em){
@@ -30,7 +30,7 @@
3030
}
3131

3232
.md-tabs__item {
33-
height: 1.75rem !important;
33+
height: unset;
3434
}
3535

3636
/* Search bar
@@ -45,7 +45,7 @@
4545
font-weight: bold;
4646
}
4747

48-
/* Search bar - black palette
48+
/* Search bar - black palette
4949
*/
5050

5151
[data-md-color-primary=black] .md-search-result mark {
@@ -149,14 +149,19 @@
149149
color: #6F6B6B;
150150
font-weight: 400;
151151
font-size: 0.65rem;
152-
padding-top: 15px;
152+
clear: right;
153153
}
154154

155155
.md-footer-meta.md-typeset a {
156156
color: #6F6B6B !important;
157157
font-weight: 400;
158158
}
159159

160+
.md-footer-meta img {
161+
margin-top: 4px;
162+
height: 1em;
163+
}
164+
160165
/* footer - black palette
161166
*/
162167

@@ -222,6 +227,7 @@
222227
padding: 0;
223228
}
224229

230+
225231
h2.divider {
226232
text-align: center;
227233
max-width: 650px;
@@ -298,7 +304,7 @@ pre code::-webkit-scrollbar-thumb:hover, .codehilite pre::-webkit-scrollbar-thum
298304
opacity: 0;
299305
pointer-events: none;
300306
}
301-
307+
302308
// Back-to-top button on focus/hover
303309
&:focus,
304310
&:hover {

0 commit comments

Comments
 (0)