Skip to content

Commit e8e5c45

Browse files
correct encoding and manifest oversights
1 parent b76ba89 commit e8e5c45

File tree

7 files changed

+20
-10
lines changed

7 files changed

+20
-10
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ include CHANGELOG.md
1818

1919
recursive-include testing *.bash
2020
prune nextgen
21+
prune .cursor
2122

2223
recursive-include docs *.md
2324
include docs/examples/version_scheme_code/*.py
2425
include docs/examples/version_scheme_code/*.toml
2526
include mkdocs.yml
27+
include uv.lock

testing/test_better_root_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_version_missing_with_relative_to_set(wd: WorkDir) -> None:
138138

139139
# Create a dummy file to use as relative_to
140140
dummy_file = subdir / "setup.py"
141-
dummy_file.write_text("# dummy file")
141+
dummy_file.write_text("# dummy file", encoding="utf-8")
142142

143143
# Test error message when relative_to IS set
144144
config = Configuration(root=str(subdir), relative_to=str(dummy_file))

testing/test_git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ def test_fail_on_missing_submodules_with_initialized_submodules(wd: WorkDir) ->
666666

667667
# Create a commit in the submodule
668668
test_file = submodule_dir / "test.txt"
669-
test_file.write_text("test content")
669+
test_file.write_text("test content", encoding="utf-8")
670670
wd(["git", "-C", str(submodule_dir), "add", "test.txt"])
671671
wd(["git", "-C", str(submodule_dir), "commit", "-m", "Initial commit"])
672672

@@ -741,7 +741,7 @@ def test_nested_scm_git_config_from_toml(tmp_path: Path) -> None:
741741
[tool.setuptools_scm.scm.git]
742742
pre_parse = "fail_on_missing_submodules"
743743
"""
744-
pyproject_path.write_text(pyproject_content)
744+
pyproject_path.write_text(pyproject_content, encoding="utf-8")
745745

746746
# Parse the configuration from file
747747
config = Configuration.from_file(pyproject_path)

testing/test_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ def test_pretend_metadata_with_version(
339339
write_to="src/version.py", write_to_template=version_file_content
340340
)
341341

342-
content = (wd.cwd / "src/version.py").read_text()
342+
content = (wd.cwd / "src/version.py").read_text(encoding="utf-8")
343343
assert "commit_hash = 'g1337beef'" in content
344344
assert "num_commit = 4" in content
345345

@@ -412,7 +412,7 @@ def test_pretend_metadata_with_scm_version(
412412
write_to="src/version.py", write_to_template=version_file_content
413413
)
414414

415-
content = (wd.cwd / "src/version.py").read_text()
415+
content = (wd.cwd / "src/version.py").read_text(encoding="utf-8")
416416
assert "commit_hash = 'gcustom123'" in content
417417
assert "num_commit = 7" in content
418418

testing/test_pyproject_reading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_read_pyproject_existing_file(self, tmp_path: Path) -> None:
4545
[tool.setuptools_scm]
4646
"""
4747
pyproject_file = tmp_path / "pyproject.toml"
48-
pyproject_file.write_text(pyproject_content)
48+
pyproject_file.write_text(pyproject_content, encoding="utf-8")
4949

5050
result = read_pyproject(path=pyproject_file)
5151

testing/test_regressions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def test_case_mismatch_nested_dir_windows_git(tmp_path: Path) -> None:
114114
nested_dir.mkdir()
115115

116116
# Create a pyproject.toml in the nested directory
117-
(nested_dir / "pyproject.toml").write_text("""
117+
(nested_dir / "pyproject.toml").write_text(
118+
"""
118119
[build-system]
119120
requires = ["setuptools>=64", "setuptools-scm"]
120121
build-backend = "setuptools.build_meta"
@@ -124,7 +125,9 @@ def test_case_mismatch_nested_dir_windows_git(tmp_path: Path) -> None:
124125
dynamic = ["version"]
125126
126127
[tool.setuptools_scm]
127-
""")
128+
""",
129+
encoding="utf-8",
130+
)
128131

129132
# Add and commit the file
130133
run("git add .", repo_path)
@@ -159,7 +162,7 @@ def test_case_mismatch_force_assertion_failure(tmp_path: Path) -> None:
159162
nested_dir.mkdir()
160163

161164
# Add and commit something to make it a valid repo
162-
(nested_dir / "test.txt").write_text("test")
165+
(nested_dir / "test.txt").write_text("test", encoding="utf-8")
163166
run("git add .", repo_path)
164167
run("git commit -m 'Initial commit'", repo_path)
165168

tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ ignore=E203,W503
99

1010
[testenv]
1111
usedevelop=True
12-
extras=test
12+
dependency_groups = test
13+
deps =
14+
pytest
15+
pytest-cov
16+
pytest-timeout
17+
pytest-xdist
1318
commands=
1419
python -X warn_default_encoding -m pytest {posargs}
1520

0 commit comments

Comments
 (0)