Skip to content

Commit 2609cac

Browse files
authored
Merge branch 'master' into bcwu-is-python-enabled
2 parents 74c5aaf + c5e0d87 commit 2609cac

File tree

46 files changed

+2724
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2724
-151
lines changed

.github/pull_request_template.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
<!--- Provide a general summary of your changes in the title. -->
1+
<!-- Provide a general summary of your changes in the title. -->
2+
<!-- Examples: Updates pull request template -->
23

3-
## Description
4-
<!--- Please describe the problem you are addressing and your proposed changes. -->
4+
## Intent
5+
<!-- Describe what problem you are addressing in this pull request. -->
6+
<!-- If this change is associated with an open issue, please link to it here. -->
7+
<!-- Example: "Resolves #24" -->
8+
<!-- See https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue -->
59

6-
## Motivation and Context
7-
<!--- Even small changes deserve a little attention to detail. -->
8-
<!--- Why is this change required? What problem does it solve? -->
9-
<!--- If it fixes an open issue, please link to the issue here. -->
10-
<!--- Example: "Addresses Issue # 1" -->
10+
## Type of Change
11+
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
12+
<!-- If you check more than one box, you may need to refactor this change into separate pull requests -->
1113

12-
## How Has This Been Tested?
13-
<!--- Please describe in detail how you tested your changes. -->
14-
<!--- Automation should be used to verify that a change remains in place. -->
15-
<!--- Automated tests should be included in this pull request. -->
14+
- [ ] Bug Fix <!-- A change which fixes an existing issue -->
15+
- [ ] New Feature <!-- A change which adds additional functionality -->
16+
- [ ] Breaking Change <!-- A breaking change which causes existing functionality to change -->
1617

17-
<!--- If applicable, enumerate the steps that someone can take to exercise this change manually. -->
18-
<!--- Please include details of your testing environment. -->
19-
<!--- Detail is important! -->
18+
## Approach
19+
<!-- Describe how you solved this problem and any trade-offs you encountered. -->
20+
<!-- Link any additional documentation associated with this change here -->
2021

21-
### Screenshots (if appropriate):
22+
## Automated Tests
23+
<!-- Describe the automated tests associated with this change. -->
24+
<!-- If automated tests are not included in this change, please state why. -->
2225

23-
## Types of Changes
24-
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
25-
- [ ] Bug fix (non-breaking change which fixes an issue)
26-
- [ ] New feature (non-breaking change which adds functionality)
27-
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
26+
## Directions for Reviewers
27+
<!-- Provide steps for reviewers to validate this change manually. -->
2828

29-
## Checklist:
29+
## Checklist
3030
<!--- Go over all the following points, and put an `x` in all the boxes that apply: -->
3131
<!--- If you need clarification on any of these, feel free to ask. We're here to help! -->
32-
- [ ] I have added tests to cover my changes.
3332
- [ ] I have updated [CHANGELOG.md](../CHANGELOG.md) to cover notable changes.
33+
- [ ] I have updated all related GitHub issues to reflect their current state.

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,75 @@ All notable changes to this project will be documented in this file.
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).
66

7+
## Unreleased
8+
9+
### Added
10+
- The `CONNECT_REQUEST_TIMEOUT` environment variable, which configures the request timeout for all blocking HTTP and HTTPS operations. This value translates into seconds (e.g., `CONNECT_REQUEST_TIMEOUT=60` is equivalent to 60 seconds.) By default, this value is 300.
11+
12+
## [1.15.0] - 2023-03-15
13+
14+
### Added
15+
- Added `deploy voila` command to deploy Jupyter Voila notebooks. See the [user documentation](https://docs.posit.co/connect/user/publishing-cli-notebook/#interactive-voila-deployment)
16+
for more information.
17+
18+
### Changed
19+
- `deploy html` was refactored. Its behavior is described below.
20+
21+
#### Deploying HTML
22+
Specifying a directory in the path will result in that entire directory*, subdirectories, and sub contents included in the deploy bundle. The entire directory is included whether or not an entrypoint was supplied
23+
24+
25+
e.g.
26+
using the following directory,
27+
```
28+
├─ my_project/
29+
│ ├─ index.html
30+
│ ├─ second.html
31+
```
32+
and the following command:
33+
```
34+
rsconnect deploy html -n local my_project
35+
```
36+
or this command:
37+
```
38+
rsconnect deploy html -n local my_project -e my_project/index.html
39+
```
40+
we will have a bundle which includes both `index.html` and `second.html`
41+
42+
- specifying a file in the path will result in that file* - not the entire directory - included in the deploy bundle
43+
44+
e.g.
45+
using the following directory,
46+
```
47+
├─ my_project/
48+
│ ├─ index.html
49+
│ ├─ second.html
50+
```
51+
and the following command:
52+
```
53+
rsconnect deploy html -n local my_project/second.html
54+
```
55+
we will have a bundle which includes `second.html`
56+
57+
- a note regarding entrypiont
58+
- providing an entrypoint is optional if there's an `index.html` inside the project directory, or if there's a *single* html file in the project directory.
59+
- if there are multiple html files in the project directory and it contains no `index.html`, we will get an exception when deploying that directory unless an entrypoint is specified.
60+
61+
- if we want to specify an entrypint, and we are executing the deploy command outside a project folder, we must specify the full path of the entrypoint:
62+
63+
```
64+
rsconnect deploy html -n local my_project -e my_project/second.html
65+
```
66+
67+
- if we want to specify an entrypint, and we are executing the deploy command inside the project folder, we can abbreviate the entrypoint, like so:
68+
```
69+
cd my_project
70+
rsconnect deploy html -n local ./ -e second.html
71+
```
72+
73+
74+
*Plus the manifest & other necessary files needed for the bundle to work on Connect.
75+
776
## [1.14.1] - 2023-02-09
877

978
### Fixed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ a server with only Python 3.8 installed will fail to match content deployed with
2929
Python 3.7. Your administrator may also enable exact Python version matching which
3030
will be stricter and require matching major, minor, and patch versions. For more
3131
information see the [Posit Connect Admin Guide chapter titled Python Version
32-
Matching](https://docs.rstudio.com/connect/admin/python.html#python-version-matching).
32+
Matching](https://docs.posit.co/connect/admin/python/#python-version-matching).
3333

3434
### Installation
3535

@@ -722,7 +722,7 @@ of the available search flags.
722722
> **Note:** The `rsconnect content build` subcommand requires Posit Connect >= 2021.11.1
723723
724724
Posit Connect caches R and Python packages in the configured
725-
[`Server.DataDir`](https://docs.rstudio.com/connect/admin/appendix/configuration/#Server.DataDir).
725+
[`Server.DataDir`](https://docs.posit.co/connect/admin/appendix/configuration/#Server.DataDir).
726726
Under certain circumstances (examples below), these package caches can become stale
727727
and need to be rebuilt. This refresh automatically occurs when a Posit Connect
728728
user visits the content. You may wish to refresh some content before it is visited
@@ -741,7 +741,7 @@ The following are some common scenarios where performing a content build might b
741741
> **Note:** The `content build` command is non-destructive, meaning that it does nothing to purge
742742
> existing packrat/python package caches before a build. If you have an
743743
> existing cache, it should be cleared prior to starting a content build.
744-
> See the [migration documentation](https://docs.rstudio.com/connect/admin/appendix/cli/#migration) for details.
744+
> See the [migration documentation](https://docs.posit.co/connect/admin/appendix/cli/#migration) for details.
745745
746746
> **Note:** You may use the [`rsconnect content search`](#content-search) subcommand to help
747747
> identify high priority content items to build.
@@ -964,7 +964,7 @@ xargs printf -- '-g %s\n' < guids.txt | xargs rsconnect content build add
964964
```
965965
## Programmatic Provisioning
966966
967-
RStudio Connect supports the programmatic bootstrapping of an admininistrator API key
967+
Posit Connect supports the programmatic bootstrapping of an admininistrator API key
968968
for scripted provisioning tasks. This process is supported by the `rsconnect bootstrap` command,
969969
which uses a JSON Web Token to request an initial API key from a fresh Connect instance.
970970
@@ -977,4 +977,4 @@ $ rsconnect bootstrap --server https://connect.example.org:3939 --jwt-keypath /p
977977
```
978978
979979
A full description on how to use `rsconnect bootstrap` in a provisioning workflow is provided in the Connect administrator guide's
980-
[programmatic provisioning](https://docs.rstudio.com/connect/admin/programmatic-provisioning) documentation.
980+
[programmatic provisioning](https://docs.posit.co/connect/admin/programmatic-provisioning) documentation.

docs/mkdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
site_name: 'Posit Connect: rsconnect-python'
22
copyright: Posit Software, PBC. All Rights Reserved
33

4+
# We activate GA only when hosted on our public docs site
5+
# and not when installed.
6+
#
7+
# See overrides/partials/integrations/analytics.html
8+
google_analytics:
9+
- 'GTM-KHBDBW7'
10+
- 'auto'
11+
412
markdown_extensions:
513
- toc:
614
permalink: "#"

docs/overrides/partials/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<div class="md-flex__cell md-flex__cell--shrink left-nav">
8282
<ul class="md-tabs__list">
8383
<li class="md-tabs__item"><a href="{{ base_url }}/../news/" title="Release Notes" class="md-tabs__link md-source">Release Notes</a></li>
84-
<li class="md-tabs__item"><a href="https://support.rstudio.com/hc/en-us" title="Posit Support" class="md-tabs__link md-source">Help</a></li>
84+
<li class="md-tabs__item"><a href="https://support.posit.co/hc/en-us" title="Posit Support" class="md-tabs__link md-source">Help</a></li>
8585
<li class="md-tabs__item"><a href="https://www.posit.co/" title="Posit" class="md-tabs__link md-source logo"></a></li>
8686
</ul>
8787
</div>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{% set property = config.google_analytics %}
2+
<!-- Google Analytics 4 (G-XXXXXXXXXX) -->
3+
<script>
4+
/* Use GA when hosted by our public docs site, not when installed. */
5+
if (location.href.indexOf("docs.posit.co") >= 0) {
6+
window.dataLayer = window.dataLayer || []
7+
function gtag() { dataLayer.push(arguments) }
8+
/* Set up integration and send page view */
9+
gtag("js", new Date())
10+
gtag("config", "{{ property[0] }}")
11+
12+
/* Register virtual event handlers */
13+
document.addEventListener("DOMContentLoaded", function () {
14+
if (document.forms.search) {
15+
var query = document.forms.search.query
16+
query.addEventListener("blur", function () {
17+
if (this.value) {
18+
gtag("event", "search", { search_term: this.value })
19+
}
20+
})
21+
}
22+
23+
/* Send page view on location change */
24+
if (typeof location$ !== "undefined")
25+
location$.subscribe(function (url) {
26+
gtag("config", "{{ property[0] }}", {
27+
page_path: url.pathname
28+
})
29+
})
30+
})
31+
/* Create script tag */
32+
var script = document.createElement("script")
33+
script.async = true
34+
script.src = "https://www.googletagmanager.com/gtag/js?id={{ property[0] }}"
35+
36+
/* Inject script tag */
37+
var container = document.getElementsByTagName("head")[0]
38+
var firstChild = container.firstChild
39+
container.insertBefore(script, firstChild)
40+
}
41+
</script>

integration-testing/.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
/client-python/
2-
/cypress/videos/
3-
/cypress/screenshots/
1+
client-python/
2+
cypress/videos/
3+
cypress/screenshots/
4+
content/*/.ipynb_checkpoints

integration-testing/content/notebook/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ This stock report is generated using Python and Jupyter Notebook. Stock prices a
99

1010
* [Jupyter Homepage](https://jupyter.org/)
1111
* [Jupyter Documentation](https://jupyter.org/documentation)
12-
* [Using Jupyter Notebooks in {systemDisplayName}](https://docs.rstudio.com/connect/user/jupyter-notebook/)
13-
* [User Guide for rsconnect_jupyter](https://docs.rstudio.com/rsconnect-jupyter/)
12+
* [Using Jupyter Notebooks in {systemDisplayName}](https://docs.posit.co/connect/user/jupyter-notebook/)
13+
* [User Guide for rsconnect_jupyter](https://docs.posit.co/rsconnect-jupyter/)
1414

1515
## Requirements
1616

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"In this app we:\n",
8+
"* Plot the gaussian density for a specific $\\mu$ and $\\sigma$\n",
9+
"* Use the FloatSlider widget in ipywidgets to represent $\\mu$ and $\\sigma$ values\n",
10+
"* Stack the density plot along with the sliders into a nice layout using HBox and VBox layout objects available in ipywidgets\n",
11+
"* Link the sliders to the plot so that the plot gets updated when the values of $\\mu$ and $\\sigma$ change\n",
12+
"\n",
13+
"Find the code [here](https://github.com/pbugnion/voila-gallery/blob/master/gaussian-density/index.ipynb).\n",
14+
"\n",
15+
"This example is taken from [ChakriCherukuri/mlviz](https://github.com/ChakriCherukuri/mlviz)."
16+
]
17+
},
18+
{
19+
"cell_type": "code",
20+
"execution_count": null,
21+
"metadata": {},
22+
"outputs": [],
23+
"source": [
24+
"import numpy as np\n",
25+
"from scipy.stats import norm\n",
26+
"\n",
27+
"from ipywidgets import FloatSlider, HBox, VBox\n",
28+
"import bqplot.pyplot as plt"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": null,
34+
"metadata": {},
35+
"outputs": [],
36+
"source": [
37+
"x = np.linspace(-10, 10, 200)\n",
38+
"y = norm.pdf(x)\n",
39+
"\n",
40+
"# plot the gaussian density\n",
41+
"title_tmpl = 'Gaussian Density (mu = {} and sigma = {})'\n",
42+
"pdf_fig = plt.figure(title=title_tmpl.format(0, 1))\n",
43+
"pdf_line = plt.plot(x, y, 'm', stroke_width=3)"
44+
]
45+
},
46+
{
47+
"cell_type": "code",
48+
"execution_count": null,
49+
"metadata": {},
50+
"outputs": [],
51+
"source": [
52+
"# use two sliders to represent mu and sigma\n",
53+
"mu_slider = FloatSlider(description='mu', value=0, min=-5, max=5, step=.1)\n",
54+
"sigma_slider = FloatSlider(description='sigma', value=1, min=0.1, max=5, step=.1)\n",
55+
"\n",
56+
"slider_layout = HBox([mu_slider, sigma_slider])"
57+
]
58+
},
59+
{
60+
"cell_type": "code",
61+
"execution_count": null,
62+
"metadata": {},
63+
"outputs": [],
64+
"source": [
65+
"def update_density(change):\n",
66+
" new_mu = mu_slider.value\n",
67+
" new_sigma = sigma_slider.value\n",
68+
" # update the y attribute of the plot with the new pdf\n",
69+
" # computed using new mu and sigma values\n",
70+
" pdf_line.y = norm.pdf(x, new_mu, new_sigma)\n",
71+
" \n",
72+
" # also update the fig title\n",
73+
" pdf_fig.title = title_tmpl.format(new_mu, new_sigma)\n",
74+
"\n",
75+
"# register the above callback with the 'value' trait of the sliders\n",
76+
"mu_slider.observe(update_density, 'value')\n",
77+
"sigma_slider.observe(update_density, 'value')"
78+
]
79+
},
80+
{
81+
"cell_type": "code",
82+
"execution_count": null,
83+
"metadata": {},
84+
"outputs": [],
85+
"source": [
86+
"# now put all the widgets together into a simple dashboard\n",
87+
"# the plot should update now when the slider values are updated!\n",
88+
"final_layout = VBox([pdf_fig, slider_layout])\n",
89+
"final_layout"
90+
]
91+
}
92+
],
93+
"metadata": {
94+
"kernelspec": {
95+
"display_name": "Python 3 (ipykernel)",
96+
"language": "python",
97+
"name": "python3"
98+
},
99+
"language_info": {
100+
"codemirror_mode": {
101+
"name": "ipython",
102+
"version": 3
103+
},
104+
"file_extension": ".py",
105+
"mimetype": "text/x-python",
106+
"name": "python",
107+
"nbconvert_exporter": "python",
108+
"pygments_lexer": "ipython3",
109+
"version": "3.9.16"
110+
},
111+
"rsconnect": {
112+
"previousServerId": null,
113+
"servers": {},
114+
"version": 1
115+
}
116+
},
117+
"nbformat": 4,
118+
"nbformat_minor": 2
119+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
bqplot
3+
scipy
4+
voila

0 commit comments

Comments
 (0)