Skip to content

Commit 45f63e7

Browse files
authored
Merge pull request #3972 from SFDO-Tooling/chore/dev-tooling-modernization
refactor: dev tooling modernization (Ruff, Makefile, deprecations) @W-22187458
2 parents f3c293a + 932bc5d commit 45f63e7

169 files changed

Lines changed: 1211 additions & 1185 deletions

File tree

Some content is hidden

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

.flake8

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

.pre-commit-config.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
default_language_version:
22
python: python3
33
repos:
4-
- repo: https://github.com/ambv/black
5-
rev: 22.3.0
4+
- repo: https://github.com/astral-sh/ruff-pre-commit
5+
rev: v0.15.8
66
hooks:
7-
- id: black
7+
- id: ruff
8+
args: [--fix]
9+
- id: ruff-format
810
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v2.0.0
11+
rev: v5.0.0
1012
hooks:
1113
- id: check-merge-conflict
12-
- id: flake8
1314
- id: debug-statements
1415
exclude: "cumulusci/(utils/logging|cli/cci|tasks/robotframework/debugger/ui|cli/task|robotframework/utils).py"
1516
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
1617
rev: v1.0.1
1718
hooks:
1819
- id: rst-linter
1920
exclude: "docs"
20-
- repo: https://github.com/pycqa/isort
21-
rev: 5.12.0
22-
hooks:
23-
- id: isort
24-
args: ["--profile", "black", "--filter-files"]
2521
- repo: https://github.com/pre-commit/mirrors-prettier
2622
rev: v3.1.0
2723
hooks:

.prettierignore

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
Test*.yaml
1+
# Jinja-templated HTML: Prettier lowercases <!DOCTYPE>, which breaks
2+
# xml.etree.ElementTree.parse() in RobotLibDoc tests.
3+
cumulusci/tasks/robotframework/template.html
4+
5+
# VCR cassettes are YAML-shaped but not reliably parseable by Prettier's YAML
6+
# formatter (multi-line quoted bodies, anchors, etc.).
7+
**/cassettes/**
8+
9+
# Bundled third-party diagram assets (minified JS/CSS).
210
docs/diagram/
3-
**/*.min.js
4-
**/*.min.css
5-
cumulusci/files/templates/
11+
12+
# Jinja-templated JSON/YAML shipped as project templates.
13+
cumulusci/files/templates/

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sphinx:
2727
formats:
2828
- pdf
2929
- epub
30-
# Optionally declare the Python requirements required to build your docs
30+
# Optionally declare the Python requirements required to build your docs
3131
# python:
3232
# install:
3333
# - requirements: requirements_dev.txt

CODE_OF_CONDUCT.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,23 @@ socioeconomic status, or other similar personal characteristics.
3535
Examples of behavior that contributes to creating a positive environment
3636
include:
3737

38-
* Using welcoming and inclusive language
39-
* Being respectful of differing viewpoints and experiences
40-
* Gracefully accepting constructive criticism
41-
* Focusing on what is best for the community
42-
* Showing empathy toward other community members
38+
- Using welcoming and inclusive language
39+
- Being respectful of differing viewpoints and experiences
40+
- Gracefully accepting constructive criticism
41+
- Focusing on what is best for the community
42+
- Showing empathy toward other community members
4343

4444
Examples of unacceptable behavior by participants include:
4545

46-
* The use of sexualized language or imagery and unwelcome sexual attention or
47-
advances
48-
* Personal attacks, insulting/derogatory comments, or trolling
49-
* Public or private harassment
50-
* Publishing, or threatening to publish, others' private information—such as
51-
a physical or electronic address—without explicit permission
52-
* Other conduct which could reasonably be considered inappropriate in a
53-
professional setting
54-
* Advocating for or encouraging any of the above behaviors
46+
- The use of sexualized language or imagery and unwelcome sexual attention or
47+
advances
48+
- Personal attacks, insulting/derogatory comments, or trolling
49+
- Public or private harassment
50+
- Publishing, or threatening to publish, others' private information—such as
51+
a physical or electronic address—without explicit permission
52+
- Other conduct which could reasonably be considered inappropriate in a
53+
professional setting
54+
- Advocating for or encouraging any of the above behaviors
5555

5656
## Our Responsibilities
5757

@@ -98,7 +98,7 @@ It includes adaptions and additions from [Go Community Code of Conduct][golang-c
9898

9999
This Code of Conduct is licensed under the [Creative Commons Attribution 3.0 License][cc-by-3-us].
100100

101-
[contributor-covenant-home]: https://www.contributor-covenant.org (https://www.contributor-covenant.org/)
101+
[contributor-covenant-home]: https://www.contributor-covenant.org "https://www.contributor-covenant.org/"
102102
[golang-coc]: https://golang.org/conduct
103103
[cncf-coc]: https://github.com/cncf/foundation/blob/master/code-of-conduct.md
104104
[microsoft-coc]: https://opensource.microsoft.com/codeofconduct/

Makefile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ clean-pyc: ## remove Python file artifacts
4040
find . -name '__pycache__' -exec rm -fr {} +
4141

4242
clean-test: ## remove test and coverage artifacts
43-
rm -fr .tox/
4443
rm -f .coverage
4544
rm -fr htmlcov/
4645
rm -f output.xml
4746
rm -f report.html
4847

49-
lint: ## check style with flake8
50-
flake8 cumulusci tests
48+
lint: ## check style with ruff and pyright
49+
ruff check cumulusci tests
50+
ruff format --check cumulusci tests
5151

5252
test: ## run tests quickly with the default Python
5353
pytest
5454

55-
test-all: ## run tests on every Python version with tox
56-
tox
55+
test-all: ## run tests on every Python version via CI matrix
56+
@echo "Multi-version testing runs in CI. Use 'pytest' for local testing."
5757

5858
# Use CLASS_PATH to run coverage for a subset of tests.
5959
# $ make coverage CLASS_PATH="cumulusci/core/tests"
@@ -82,7 +82,6 @@ servedocs: docs ## compile the docs watching for changes
8282
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
8383

8484
release: clean ## package and upload a release
85-
python utility/pin_dependencies.py
8685
hatch build
8786
hatch publish
8887

@@ -97,15 +96,11 @@ tag: clean
9796
git tag -a -m 'version $$(hatch version)' v$$(hatch version)
9897
git push --follow-tags
9998

100-
update-deps:
101-
echo Use the _Update Python Dependencies_ Github action for real releases
102-
pip-compile --upgrade --resolver=backtracking --output-file=requirements/prod.txt pyproject.toml
103-
pip-compile --upgrade --resolver=backtracking --output-file=requirements/dev.txt --all-extras pyproject.toml
99+
update-deps: ## update all dependencies via uv
100+
uv lock --upgrade
104101

105-
dev-install:
106-
python -m pip install --upgrade pip pip-tools setuptools
107-
pip-sync requirements/*.txt
108-
python -m pip install -e .
102+
dev-install: ## install development dependencies via uv
103+
uv sync --group dev
109104

110105
schema:
111106
python -c 'from cumulusci.utils.yaml import cumulusci_yml; open("cumulusci/schema/cumulusci.jsonschema.json", "w").write(cumulusci_yml.CumulusCIRoot.schema_json(indent=4))'

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Please report any security issue to [security@salesforce.com](mailto:security@sa
44
as soon as it is discovered. This library limits its runtime dependencies in
55
order to reduce the total cost of ownership as much as can be, but all consumers
66
should remain vigilant and have their security stakeholders review all third-party
7-
products (3PP) like this one and their dependencies.
7+
products (3PP) like this one and their dependencies.

cumulusci/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
if sys.version_info < (3, 8): # pragma: no cover
1515
raise Exception("CumulusCI requires Python 3.8+.")
1616

17-
api.OrderedDict = dict
18-
bulk.OrderedDict = dict
17+
api.OrderedDict = dict # pyright: ignore[reportPrivateImportUsage]
18+
bulk.OrderedDict = dict # pyright: ignore[reportPrivateImportUsage]

cumulusci/cli/flow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def flow_doc(runtime, project=False):
4444
flows_by_group = group_items(flows)
4545
flow_groups = sorted(
4646
flows_by_group.keys(),
47-
key=lambda group: flow_info_groups.index(group)
48-
if group in flow_info_groups
49-
else 100,
47+
key=lambda group: (
48+
flow_info_groups.index(group) if group in flow_info_groups else 100
49+
),
5050
)
5151

5252
for group in flow_groups:

cumulusci/cli/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
""" CLI logger """
1+
"""CLI logger"""
2+
23
import logging
34
import os
45
import sys

0 commit comments

Comments
 (0)