Skip to content

Commit c2c7cae

Browse files
committed
Update dependencies and drop python <3.11
Use pyproject.toml via uv for dependency management Freezing dependencies does so for a single platform (e.g. linux) and Python version (3.12). Because a dependency can include environment markers to specify transitive dependencies a requirements.txt file generated on one platform/version can fail to install on another. This commit modifies our feature test workflow to use pip's local project installs to provide the correct dependency resolutions for each platform and python version. - Adjusted the Python version matrix in GitHub workflows to include Python 3.11, 3.12, and 3.13, removing older versions. - Simplified the GitHub workflows to use uv
1 parent 0ecf5f4 commit c2c7cae

16 files changed

Lines changed: 2056 additions & 701 deletions

.github/workflows/feature_test.yml

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,22 @@ jobs:
2222
uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 1
25-
- name: Set up Python 3.8
25+
- name: Set up Python 3.11
2626
id: py
2727
uses: actions/setup-python@v4
2828
with:
29-
python-version: 3.8
30-
cache: pip
31-
cache-dependency-path: "requirements/*.txt"
29+
python-version: 3.11
30+
- name: Set up uv
31+
uses: SFDO-Tooling/setup-uv@main
32+
with:
33+
version: "0.5.0"
34+
enable-cache: true
3235
- name: Install dependencies
33-
run: pip install -r requirements_dev.txt
36+
run: uv sync --group docs
3437
- name: Build Docs
35-
run: make docs
38+
run: |
39+
cd docs
40+
uv run sphinx-build -b html . ./_build
3641
3742
unit_tests:
3843
name: "Unit tests: ${{ matrix.os }}-${{ matrix.python-version }}"
@@ -41,39 +46,39 @@ jobs:
4146
fail-fast: false
4247
matrix:
4348
os: [macos-latest, SFDO-Tooling-Ubuntu, SFDO-Tooling-Windows]
44-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
45-
exclude:
46-
- os: macos-latest
47-
python-version: 3.8
48-
include:
49-
- os: macos-13
50-
python-version: 3.8
49+
python-version: ["3.11", "3.12", "3.13"]
5150
steps:
5251
- uses: actions/checkout@v4
5352
- name: Set up Python
5453
uses: actions/setup-python@v4
5554
with:
5655
python-version: "${{ matrix.python-version }}"
57-
cache: pip
58-
cache-dependency-path: "requirements/*.txt"
56+
- name: Set up uv
57+
uses: SFDO-Tooling/setup-uv@main
58+
with:
59+
version: "0.5.0"
60+
enable-cache: true
5961
- name: Install dependencies
60-
run: pip install -r requirements_dev.txt
62+
run: uv sync -p ${{ matrix.python-version }}
6163
- name: Run Pytest
62-
run: pytest --cov-report= --cov=cumulusci
64+
run: uv run pytest --cov-report= --cov=cumulusci
6365

6466
robot_api:
6567
name: "Robot: No browser"
6668
runs-on: SFDO-Tooling-Ubuntu
6769
steps:
6870
- uses: actions/checkout@v4
69-
- name: Set up Python 3.8
71+
- name: Set up Python 3.11
7072
uses: actions/setup-python@v4
7173
with:
72-
python-version: 3.8
73-
cache: pip
74-
cache-dependency-path: "requirements/*.txt"
75-
- name: Install Python dependencies
76-
run: pip install -r requirements_dev.txt
74+
python-version: 3.11
75+
- name: Set up uv
76+
uses: SFDO-Tooling/setup-uv@main
77+
with:
78+
version: "0.5.0"
79+
enable-cache: true
80+
- name: Install dependencies
81+
run: uv sync -p 3.11
7782
- name: Install sfdx
7883
run: |
7984
mkdir sfdx
@@ -90,15 +95,15 @@ jobs:
9095
SFDX_HUB_USERNAME: ${{ secrets.SFDX_HUB_USERNAME }}
9196
- name: Run robot tests
9297
run: |
93-
coverage run --append $(which cci) task run robot \
98+
uv run coverage run --append $(which cci) task run robot \
9499
--org dev \
95100
-o name "CumulusCI" \
96101
-o suites cumulusci/robotframework/tests \
97102
-o include no-browser
98103
- name: Delete scratch org
99104
if: always()
100105
run: |
101-
cci org scratch_delete dev
106+
uv run cci org scratch_delete dev
102107
- name: Store robot results
103108
if: failure()
104109
uses: actions/upload-artifact@v4

.github/workflows/pre-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ jobs:
2222
runs-on: SFDO-Tooling-Ubuntu
2323
steps:
2424
- uses: actions/checkout@main
25-
- name: Set up Python 3.8
25+
- name: Set up Python 3.11
2626
uses: actions/setup-python@v4
2727
with:
28-
python-version: 3.8
28+
python-version: 3.11
2929
cache: pip
3030
- name: Install build tool
3131
run: python -m pip install hatch

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ jobs:
1515
runs-on: SFDO-Tooling-Ubuntu
1616
steps:
1717
- uses: actions/checkout@main
18-
- name: Set up Python 3.8
18+
- name: Set up Python 3.11
1919
uses: actions/setup-python@v4
2020
with:
21-
python-version: 3.8
21+
python-version: 3.11
2222
cache: pip
2323
- name: Install build tools
2424
run: python -m pip install hatch tomli tomli-w
25-
- name: Pin dependencies
26-
run: python utility/pin_dependencies.py
2725
- name: Build source tarball and binary wheel
2826
run: hatch build -c
2927
- name: Upload to PyPI

.github/workflows/release_test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ jobs:
3737
runs-on: SFDO-Tooling-Ubuntu
3838
steps:
3939
- uses: actions/checkout@v3
40-
- name: Set up Python 3.8
40+
- name: Set up Python 3.11
4141
uses: actions/setup-python@v4
4242
with:
43-
python-version: 3.8
43+
python-version: 3.11
4444
cache: pip
45-
cache-dependency-path: "requirements/*.txt"
45+
cache-dependency-path: "pyproject.toml"
4646
- name: Install build tools
4747
run: pip install hatch
4848
- name: Test source tarball and binary wheel
@@ -71,14 +71,14 @@ jobs:
7171
concurrency: release
7272
steps:
7373
- uses: actions/checkout@v3
74-
- name: Set up Python 3.8
74+
- name: Set up Python 3.11
7575
uses: actions/setup-python@v4
7676
with:
77-
python-version: 3.8
77+
python-version: 3.11
7878
cache: pip
79-
cache-dependency-path: "requirements/*.txt"
79+
cache-dependency-path: "pyproject.toml"
8080
- name: Install Python dependencies
81-
run: pip install -r requirements_dev.txt
81+
run: pip install .[test]
8282
- name: Install sfdx
8383
run: |
8484
mkdir sfdx

.github/workflows/slow_integration_tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
runs-on: SFDO-Tooling-Ubuntu
2626
steps:
2727
- uses: actions/checkout@v2
28-
- name: Set up Python 3.8
28+
- name: Set up Python 3.11
2929
uses: actions/setup-python@v4
3030
with:
31-
python-version: 3.8
31+
python-version: 3.11
3232
cache: pip
33-
cache-dependency-path: "requirements/*.txt"
33+
cache-dependency-path: "pyproject.toml"
3434
- name: Install Python dependencies
3535
run: |
3636
python -m pip install -U pip
37-
pip install -r requirements_dev.txt
37+
pip install .[test]
3838
- name: Install sfdx
3939
run: |
4040
mkdir sfdx
@@ -73,14 +73,14 @@ jobs:
7373
# org-shape: "prerelease"
7474
steps:
7575
- uses: actions/checkout@v2
76-
- name: Set up Python 3.8
76+
- name: Set up Python 3.11
7777
uses: actions/setup-python@v4
7878
with:
79-
python-version: 3.8
79+
python-version: 3.11
8080
cache: pip
81-
cache-dependency-path: "requirements/*.txt"
81+
cache-dependency-path: "pyproject.toml"
8282
- name: Install Python dependencies
83-
run: pip install -r requirements_dev.txt
83+
run: pip install .[test]
8484
- name: Install sfdx
8585
run: |
8686
mkdir sfdx

.github/workflows/update_dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ jobs:
77
update_python_dependencies:
88
uses: SFDO-Tooling/.github/.github/workflows/update_python_dependencies.yml@main
99
with:
10-
python-version: 3.8
10+
python-version: 3.11

cumulusci/tasks/robotframework/tests/test_robotframework.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ def test_pageobject_docstring(self):
762762

763763

764764
class TestRobotPerformanceKeywords:
765-
def setup(self):
765+
def setup_method(self):
766766
self.datadir = os.path.dirname(__file__)
767767

768768
@contextmanager

cumulusci/utils/tests/test_fileutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def test_resource_test_resource_doesnt_exist_pathlib_relpath(self):
199199

200200

201201
class TestFSResourceTempdir(_TestFSResourceShared):
202-
def setup(self):
202+
def setup_method(self):
203203
self.tempdir = TemporaryDirectory()
204204
self.file = Path(self.tempdir.name) / "testfile.txt"
205205
self.file.touch()

cumulusci/utils/yaml/model_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from pathlib import Path, Sequence
2-
from typing import IO, Union
1+
from pathlib import Path
2+
from typing import IO, Sequence, Union
33

44
from pydantic import BaseModel, ValidationError
55
from pydantic.error_wrappers import ErrorWrapper

pyproject.toml

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "cumulusci"
77
dynamic = ["readme", "version"]
88
description = "Build and release tools for Salesforce developers"
99
license = { text = "BSD 3-Clause License" }
10-
requires-python = ">=3.8"
10+
requires-python = ">=3.11"
1111
authors = [
1212
{ name = "Salesforce.org", email = "sfdo-mrbelvedere@salesforce.com" },
1313
]
@@ -18,25 +18,21 @@ classifiers = [
1818
"License :: OSI Approved :: BSD License",
1919
"Natural Language :: English",
2020
"Programming Language :: Python :: 3",
21-
"Programming Language :: Python :: 3.8",
22-
"Programming Language :: Python :: 3.9",
23-
"Programming Language :: Python :: 3.10",
2421
"Programming Language :: Python :: 3.11",
2522
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
2624
]
2725
dependencies = [
28-
"click",
26+
"click>=8.1",
2927
"cryptography",
3028
"python-dateutil",
31-
"docutils<0.17",
3229
"Faker",
3330
"fs",
3431
"github3.py",
3532
"jinja2",
3633
"keyring<=23.0.1",
3734
"defusedxml",
3835
"lxml",
39-
"markdown-it-py==2.2.0", # resolve dependency conflict between prod/dev
4036
"MarkupSafe",
4137
"psutil",
4238
"pydantic<2",
@@ -45,38 +41,46 @@ dependencies = [
4541
"pyyaml",
4642
"requests",
4743
"requests-futures",
48-
"rich",
44+
"rich>=13.9.4",
4945
"robotframework",
46+
"SQLAlchemy<2",
5047
"robotframework-pabot",
5148
"robotframework-requests",
5249
"robotframework-seleniumlibrary<6",
53-
"rst2ansi",
50+
"rst2ansi>=0.1.5",
5451
"salesforce-bulk",
5552
"sarge",
5653
"selenium<4",
5754
"simple-salesforce==1.11.4",
58-
"snowfakery",
59-
"SQLAlchemy<2",
55+
"snowfakery>=4.0.0",
6056
"xmltodict",
6157
]
6258

63-
[project.optional-dependencies]
64-
docs = ["myst-parser", "Sphinx"]
65-
lint = ["black", "flake8<4", "isort", "pre-commit"]
66-
test = [
67-
"coverage[toml]",
68-
"factory-boy",
69-
"furo",
70-
"jsonschema",
71-
"pytest<7.1 ", # https://github.com/pytest-dev/pytest/issues/9765
72-
"pytest-cov",
73-
"pytest-random-order",
74-
"pytest-vcr",
75-
"responses",
76-
"testfixtures",
77-
"tox",
78-
"typeguard<=2.13.3", # TODO: Lots of changes required for v4
79-
"vcrpy"
59+
[dependency-groups]
60+
docs = [
61+
"myst-parser>=1.0.0",
62+
"sphinx>=5.3.0",
63+
]
64+
dev = [
65+
"coverage[toml]>=7.6.1",
66+
"factory-boy>=3.3.1",
67+
"furo>=2023.3.27",
68+
"jsonschema>=4.23.0",
69+
"pytest>=7.0.1",
70+
"pytest-cov>=5.0.0",
71+
"pytest-random-order>=1.1.1",
72+
"pytest-vcr>=1.0.2",
73+
"responses>=0.23.1",
74+
"testfixtures>=8.3.0",
75+
"tox>=4.20.0",
76+
"typeguard<=2.13.3", # TODO: Lots of changes required for v4
77+
"vcrpy>=6.0.2",
78+
]
79+
lint = [
80+
"black>=24.8.0",
81+
"flake8<4",
82+
"isort>=5.13.2",
83+
"pre-commit>=3.5.0",
8084
]
8185

8286
[project.scripts]
@@ -102,16 +106,13 @@ include = [
102106
include = [
103107
"/cumulusci",
104108
"/requirements/*", # Needed by tox
105-
"README.md", # needed by hatch-fancy-pypi-readme
106-
"docs/history.md"
109+
"README.md", # needed by hatch-fancy-pypi-readme
110+
"docs/history.md",
107111
# ditto
108112
]
109113

110114
[tool.hatch.build.targets.wheel]
111-
exclude = [
112-
"*.sql",
113-
"*.zip"
114-
]
115+
exclude = ["*.sql", "*.zip"]
115116

116117
[tool.hatch.metadata.hooks.fancy-pypi-readme]
117118
content-type = "text/markdown"
@@ -254,7 +255,7 @@ include = [
254255
'cumulusci/tests/util.py',
255256
'cumulusci/utils/waiting.py',
256257
'cumulusci/utils/xml/robot_xml.py',
257-
'cumulusci/utils/ziputils.py'
258+
'cumulusci/utils/ziputils.py',
258259
]
259260
# Do not add to this list. Instead use
260261
# # pyright: strict
@@ -290,5 +291,5 @@ strict = [
290291
'cumulusci/tasks/release_notes/exceptions.py',
291292
'cumulusci/tasks/salesforce/BaseSalesforceTask.py',
292293
'cumulusci/tasks/vlocity/exceptions.py',
293-
'cumulusci/utils/soql.py'
294+
'cumulusci/utils/soql.py',
294295
]

0 commit comments

Comments
 (0)