Skip to content

Commit a4fb69f

Browse files
authored
chore: fix code formatting (#627)
Ran `make fmt` Signed-off-by: Lucas Rodriguez <lucas.rodriguez@posit.co>
1 parent d3b38cb commit a4fb69f

File tree

8 files changed

+33
-63
lines changed

8 files changed

+33
-63
lines changed

.github/workflows/main.yml

+11-13
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
python-version: ${{ matrix.python-version }}
3939
- run: pip install '.[test]'
4040
- run: pip freeze
41-
- run: make fmt
4241
- run: make lint
4342
- run: rsconnect version
4443
- run: make test-${{ matrix.python-version }}
@@ -62,7 +61,6 @@ jobs:
6261
python-version: 3.8.x
6362
- run: pip install --pre '.[test]'
6463
- run: pip freeze
65-
- run: make fmt
6664
- run: make lint
6765
- run: rsconnect version
6866
- run: make test-3.8
@@ -188,7 +186,7 @@ jobs:
188186
run: |
189187
pytest tests/test_main_system_caches.py
190188
pytest -m 'vetiver'
191-
189+
192190
test-jupyter:
193191
runs-on: ubuntu-latest
194192
env:
@@ -211,7 +209,7 @@ jobs:
211209
- name: Start Connect + rsconnect-jupyter
212210
run: |
213211
just integration-testing/up
214-
212+
215213
- name: Run Cypress Tests
216214
run: |
217215
just integration-testing/up-cypress
@@ -235,7 +233,7 @@ jobs:
235233
path: integration-testing/cypress/screenshots
236234
if-no-files-found: ignore
237235
retention-days: 1
238-
236+
239237
test-connect:
240238
needs: distributions
241239
runs-on: ubuntu-latest
@@ -265,21 +263,21 @@ jobs:
265263
examples
266264
sparse-checkout-cone-mode: false
267265
token: ${{ secrets.CONNECT_PAT }}
268-
266+
269267
- name: Delete dotnet to save space
270268
run: sudo rm -rf /usr/share/dotnet
271-
269+
272270
- name: Build docker container-image
273271
run: |
274272
cd test/connect-rsconnect-python/test/rsconnect-python/
275273
docker compose --profile rsconnect build
276-
274+
277275
- name: Restore dist
278276
uses: actions/download-artifact@v4
279277
with:
280278
name: distributions
281279
path: dist/
282-
280+
283281
- name: Run rsconnect-python Tests
284282
env:
285283
CONNECT_LICENSE: "${{ secrets.RSC_LICENSE }}"
@@ -298,7 +296,7 @@ jobs:
298296
docker compose pull connect
299297
docker compose up -d connect
300298
just ../test/connect-rsconnect-python/test/rsconnect-python/test-rsconnect-python-repo
301-
299+
302300
# Videos are captured whether the suite fails or passes
303301
- name: Save videos
304302
uses: actions/upload-artifact@v4
@@ -307,7 +305,7 @@ jobs:
307305
name: cypress-videos_${{ matrix.PY_VERSION }}_native
308306
path: test/connect-rsconnect-python/cypress/videos
309307
if-no-files-found: ignore
310-
308+
311309
# Screenshots are only captured on failure
312310
- name: Save screenshots
313311
uses: actions/upload-artifact@v4
@@ -316,5 +314,5 @@ jobs:
316314
name: cypress-screenshots_${{ matrix.PY_VERSION }}_native
317315
path: test/connect-rsconnect-python/cypress/screenshots
318316
if-no-files-found: ignore
319-
320-
317+
318+

rsconnect/bundle.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ def get_python_env_info(
17541754
logger.debug("Environment: %s" % pformat(environment._asdict()))
17551755

17561756
if override_python_version:
1757-
environment = environment._replace(python = override_python_version)
1757+
environment = environment._replace(python=override_python_version)
17581758

17591759
return python, environment
17601760

@@ -2247,7 +2247,7 @@ def create_python_environment(
22472247
directory: str,
22482248
force_generate: bool = False,
22492249
python: Optional[str] = None,
2250-
override_python_version: Optional[str] = None
2250+
override_python_version: Optional[str] = None,
22512251
) -> Environment:
22522252
module_file = fake_module_file_from_directory(directory)
22532253

rsconnect/main.py

+13-42
Original file line numberDiff line numberDiff line change
@@ -893,10 +893,7 @@ def _warn_on_ignored_requirements(directory: str, requirements_file_name: str):
893893
@click.option(
894894
"--override-python-version",
895895
type=validation.PYTHON_VERSION,
896-
help=(
897-
"An optional python version to use instead of the version from "
898-
"the detected environment."
899-
)
896+
help=("An optional python version to use instead of the version from " "the detected environment."),
900897
)
901898
@click.option(
902899
"--force-generate",
@@ -1043,10 +1040,7 @@ def deploy_notebook(
10431040
@click.option(
10441041
"--override-python-version",
10451042
type=validation.PYTHON_VERSION,
1046-
help=(
1047-
"An optional python version to use instead of the version from "
1048-
"the detected environment."
1049-
)
1043+
help=("An optional python version to use instead of the version from " "the detected environment."),
10501044
)
10511045
@click.option(
10521046
"--force-generate",
@@ -1093,10 +1087,7 @@ def deploy_voila(
10931087
output_params(ctx, locals().items())
10941088
app_mode = AppModes.JUPYTER_VOILA
10951089
environment = create_python_environment(
1096-
path if isdir(path) else dirname(path),
1097-
force_generate,
1098-
python,
1099-
override_python_version
1090+
path if isdir(path) else dirname(path), force_generate, python, override_python_version
11001091
)
11011092

11021093
ce = RSConnectExecutor(
@@ -1252,10 +1243,7 @@ def deploy_manifest(
12521243
@click.option(
12531244
"--override-python-version",
12541245
type=validation.PYTHON_VERSION,
1255-
help=(
1256-
"An optional python version to use instead of the version from "
1257-
"the detected environment."
1258-
)
1246+
help=("An optional python version to use instead of the version from " "the detected environment."),
12591247
)
12601248
@click.option(
12611249
"--force-generate",
@@ -1613,12 +1601,9 @@ def generate_deploy_python(app_mode: AppMode, alias: str, min_version: str, desc
16131601
),
16141602
)
16151603
@click.option(
1616-
"--override-python-version",
1617-
type=validation.PYTHON_VERSION,
1618-
help=(
1619-
"An optional python version to use instead of the version from "
1620-
"the detected environment."
1621-
)
1604+
"--override-python-version",
1605+
type=validation.PYTHON_VERSION,
1606+
help=("An optional python version to use instead of the version from " "the detected environment."),
16221607
)
16231608
@click.option(
16241609
"--force-generate",
@@ -1668,10 +1653,7 @@ def deploy_app(
16681653
entrypoint = validate_entry_point(entrypoint, directory)
16691654
extra_files_list = validate_extra_files(directory, extra_files)
16701655
environment = create_python_environment(
1671-
directory,
1672-
force_generate,
1673-
python,
1674-
override_python_version=override_python_version
1656+
directory, force_generate, python, override_python_version=override_python_version
16751657
)
16761658

16771659
if app_mode == AppModes.PYTHON_SHINY:
@@ -1740,6 +1722,7 @@ def deploy_app(
17401722
generate_deploy_python(app_mode=AppModes.PYTHON_SHINY, alias="shiny", min_version="2022.07.0")
17411723
generate_deploy_python(app_mode=AppModes.PYTHON_GRADIO, alias="gradio", min_version="2024.12.0")
17421724

1725+
17431726
@deploy.command(
17441727
name="other-content",
17451728
short_help="Describe deploying other content to Posit Connect.",
@@ -1793,10 +1776,7 @@ def write_manifest():
17931776
@click.option(
17941777
"--override-python-version",
17951778
type=validation.PYTHON_VERSION,
1796-
help=(
1797-
"An optional python version to use instead of the version from "
1798-
"the detected environment."
1799-
)
1779+
help=("An optional python version to use instead of the version from " "the detected environment."),
18001780
)
18011781
@click.option(
18021782
"--force-generate",
@@ -1888,10 +1868,7 @@ def write_manifest_notebook(
18881868
@click.option(
18891869
"--override-python-version",
18901870
type=validation.PYTHON_VERSION,
1891-
help=(
1892-
"An optional python version to use instead of the version from "
1893-
"the detected environment."
1894-
)
1871+
help=("An optional python version to use instead of the version from " "the detected environment."),
18951872
)
18961873
@click.option(
18971874
"--force-generate",
@@ -2020,10 +1997,7 @@ def write_manifest_voila(
20201997
@click.option(
20211998
"--override-python-version",
20221999
type=validation.PYTHON_VERSION,
2023-
help=(
2024-
"An optional python version to use instead of the version from "
2025-
"the detected environment."
2026-
)
2000+
help=("An optional python version to use instead of the version from " "the detected environment."),
20272001
)
20282002
@click.option(
20292003
"--force-generate",
@@ -2209,10 +2183,7 @@ def generate_write_manifest_python(app_mode: AppMode, alias: str, desc: Optional
22092183
@click.option(
22102184
"--override-python-version",
22112185
type=validation.PYTHON_VERSION,
2212-
help=(
2213-
"An optional python version to use instead of the version from "
2214-
"the detected environment."
2215-
)
2186+
help=("An optional python version to use instead of the version from " "the detected environment."),
22162187
)
22172188
@click.option(
22182189
"--force-generate",

rsconnect/models.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class AppModes:
117117
STATIC_QUARTO,
118118
PYTHON_SHINY,
119119
JUPYTER_VOILA,
120-
PYTHON_GRADIO
120+
PYTHON_GRADIO,
121121
]
122122

123123
Modes = Literal[
@@ -138,7 +138,7 @@ class AppModes:
138138
"quarto-static",
139139
"python-shiny",
140140
"jupyter-voila",
141-
"python-gradio"
141+
"python-gradio",
142142
]
143143

144144
_cloud_to_connect_modes = {

rsconnect/validation.py

+1
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,5 @@ def convert(self, value: str, param: Optional[click.Parameter], ctx: Optional[cl
142142
except (AttributeError, ValueError):
143143
self.fail(f"{value!r} is not a valid python version; expected 3.x or 3.x.y", param, ctx)
144144

145+
145146
PYTHON_VERSION = PythonVersionParamType()

tests/test_models.py

-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def test_glob_matcher(self):
9090
("dir", "file", False),
9191
("*.txt", "file.txt", True),
9292
("*.txt", "file.csv", False),
93-
9493
("dir", "dir/file", False),
9594
("dir/*", "file", False),
9695
("dir/*", "dir/file", True),
@@ -99,7 +98,6 @@ def test_glob_matcher(self):
9998
("dir/*.txt", "dir/file", False),
10099
("dir/*.txt", "dir/file.txt", True),
101100
("dir/*.txt", "dir/.txt", True),
102-
103101
# recursive wildcard pattern using "/" (input paths using OS separator)
104102
("dir/**/*", "dirfile.txt", False),
105103
("dir/**/*", os.path.join("dirother", "a.txt"), False),
@@ -110,7 +108,6 @@ def test_glob_matcher(self):
110108
("dir/**/*.txt", os.path.join("dir", "a.csv"), False),
111109
("dir/**/*.txt", os.path.join("dir", "sub", "a.txt"), True),
112110
("dir/**/*.txt", os.path.join("dir", "sub", "a.csv"), False),
113-
114111
# recursive wildcards using OS path separator.
115112
(os.path.join("dir", "**", "*.txt"), os.path.join("dir", "a.txt"), True),
116113
(os.path.join("dir", "**", "*.txt"), os.path.join("dir", "sub", "a.txt"), True),

tests/test_shiny_express.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from rsconnect import shiny_express as express
44

5+
56
def test_is_express_app(tmp_path: Path):
67
tmp_file = str(tmp_path / "app.py")
78

tests/testdata/gradio/app.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import gradio as gr
22

3+
34
def greet(name, intensity):
45
return "Hello, " + name + "!" * int(intensity)
56

7+
68
demo = gr.Interface(
79
fn=greet,
810
inputs=["text", "slider"],
911
outputs=["text"],
1012
)
1113

12-
demo.launch(auth = ("username", "password"))
14+
demo.launch(auth=("username", "password"))

0 commit comments

Comments
 (0)