Skip to content

Commit dcaf6e8

Browse files
committed
random tests
1 parent b29d924 commit dcaf6e8

File tree

7 files changed

+97
-59
lines changed

7 files changed

+97
-59
lines changed

run_spec0_update.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
)
3636

3737
project_data = read_toml(toml_path)
38-
print(project_data)
3938
schedule_data = read_schedule(schedule_path)
40-
print(schedule_data)
4139
update_pyproject_toml(project_data, schedule_data)
4240

4341
write_toml(toml_path, project_data)

spec0_action/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def update_pyproject_toml(
112112
pyproject_data["project"]["requires-python"] = repr_spec_set(
113113
parse_version_spec(new_version["packages"]["python"])
114114
)
115-
116115
update_pyproject_dependencies(
117116
pyproject_data["project"]["dependencies"], new_version
118117
)

tests/test_data/pyproject.toml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
1-
[project]
2-
authors = [{ name = "Scientific Python Developers"}]
3-
name = "tests"
4-
description = "This is just a dummy package for testing the spec 0 update github action and should not be used"
5-
requires-python = ">=3.10"
6-
version = "0.1.0"
7-
dependencies = ["ipython>=8.7.0,<4", "numpy[foo,bar]>=1.10.0,<2"]
8-
91
[build-system]
10-
build-backend = "hatchling.build"
11-
requires = ["hatchling"]
12-
13-
[tool.pixi.workspace]
14-
channels = ["conda-forge"]
15-
platforms = ["linux-64"]
16-
17-
[tool.pixi.pypi-dependencies]
18-
tests = { path = ".", editable = true }
19-
scikit-learn = ">=1.2.0"
2+
requires = [
3+
"setuptools>=62.1",
4+
"setuptools_scm[toml]>=8.0.0",
5+
"wheel",
6+
]
7+
build-backend = "setuptools.build_meta"
208

21-
[tool.pixi.tasks]
22-
23-
[tool.pixi.feature.foo.dependencies]
24-
xarray = "*"
25-
26-
[tool.pixi.environments]
27-
bar = ["foo"]
28-
29-
[tool.pixi.dependencies]
30-
numpy = ">=1.10.0,<2"
9+
[project]
10+
name = "setuptools_test"
11+
requires-python = ">=3.11"
12+
dependencies = [
13+
'numpy>=1.20.0,<2',
14+
'pandas>=1.0.0,<3',
15+
'xarray>=2021.1.0',
16+
]
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[project]
2+
authors = [{ name = "Scientific Python Developers"}]
3+
name = "tests"
4+
description = "This is just a dummy package for testing the spec 0 update github action and should not be used"
5+
requires-python = ">=3.10"
6+
version = "0.1.0"
7+
dependencies = ["ipython>=8.7.0,<4", "numpy[foo,bar]>=1.10.0,<2"]
8+
9+
[build-system]
10+
build-backend = "hatchling.build"
11+
requires = ["hatchling"]
12+
13+
[tool.pixi.workspace]
14+
channels = ["conda-forge"]
15+
platforms = ["linux-64"]
16+
17+
[tool.pixi.pypi-dependencies]
18+
tests = { path = ".", editable = true }
19+
scikit-learn = ">=1.2.0"
20+
21+
[tool.pixi.tasks]
22+
23+
[tool.pixi.feature.foo.dependencies]
24+
xarray = "*"
25+
26+
[tool.pixi.environments]
27+
bar = ["foo"]
28+
29+
[tool.pixi.dependencies]
30+
numpy = ">=1.10.0,<2"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[project]
2+
authors = [{ name = "Scientific Python Developers"}]
3+
name = "tests"
4+
description = "This is just a dummy package for testing the spec 0 update github action and should not be used"
5+
requires-python = ">=3.11"
6+
version = "0.1.0"
7+
dependencies = ["ipython>=8.8.0,<4", "numpy[foo,bar]>=1.25.0,<2"]
8+
9+
[build-system]
10+
build-backend = "hatchling.build"
11+
requires = ["hatchling"]
12+
13+
[tool.pixi.workspace]
14+
channels = ["conda-forge"]
15+
platforms = ["linux-64"]
16+
17+
[tool.pixi.pypi-dependencies]
18+
tests = { path = ".", editable = true }
19+
scikit-learn = ">=1.3.0"
20+
21+
[tool.pixi.tasks]
22+
23+
[tool.pixi.feature.foo.dependencies]
24+
xarray = ">=2023.1.0"
25+
26+
[tool.pixi.environments]
27+
bar = ["foo"]
28+
29+
[tool.pixi.dependencies]
30+
numpy = ">=1.25.0,<2"
Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
1-
[project]
2-
authors = [{ name = "Scientific Python Developers"}]
3-
name = "tests"
4-
description = "This is just a dummy package for testing the spec 0 update github action and should not be used"
5-
requires-python = ">=3.11"
6-
version = "0.1.0"
7-
dependencies = ["ipython>=8.8.0,<4", "numpy[foo,bar]>=1.25.0,<2"]
8-
91
[build-system]
10-
build-backend = "hatchling.build"
11-
requires = ["hatchling"]
12-
13-
[tool.pixi.workspace]
14-
channels = ["conda-forge"]
15-
platforms = ["linux-64"]
16-
17-
[tool.pixi.pypi-dependencies]
18-
tests = { path = ".", editable = true }
19-
scikit-learn = ">=1.3.0"
2+
requires = [
3+
"setuptools>=62.1",
4+
"setuptools_scm[toml]>=8.0.0",
5+
"wheel",
6+
]
7+
build-backend = "setuptools.build_meta"
208

21-
[tool.pixi.tasks]
22-
23-
[tool.pixi.feature.foo.dependencies]
24-
xarray = ">=2023.1.0"
25-
26-
[tool.pixi.environments]
27-
bar = ["foo"]
28-
29-
[tool.pixi.dependencies]
30-
numpy = ">=1.25.0,<2"
9+
[project]
10+
name = "setuptools_test"
11+
requires-python = ">=3.11"
12+
dependencies = [
13+
'numpy>=1.25.0,<2',
14+
'pandas>=1.0.0,<3',
15+
'xarray>=2023.1.0',
16+
]

tests/test_update_pyproject_toml.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ def test_update_pyproject_toml():
99
update_pyproject_toml(pyproject_data, test_schedule)
1010

1111
assert pyproject_data == expected
12+
13+
14+
def test_update_pyproject_toml_with_pixi():
15+
expected = read_toml("tests/test_data/pyproject_pixi_updated.toml")
16+
pyproject_data = read_toml("tests/test_data/pyproject_pixi.toml")
17+
test_schedule = read_schedule("tests/test_data/test_schedule.json")
18+
update_pyproject_toml(pyproject_data, test_schedule)
19+
20+
assert pyproject_data == expected

0 commit comments

Comments
 (0)