Skip to content

Commit 65e1981

Browse files
authored
Merge pull request #560 from sanders41/mypy
Bump default mypy version 1.12.1 -> 1.13.0 and add faster-cache
2 parents ea56304 + 41f62f9 commit 65e1981

File tree

37 files changed

+67
-42
lines changed

37 files changed

+67
-42
lines changed

src/package_version.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub fn default_version(package: &PythonPackage) -> String {
191191
PythonPackage::Mkdocs => "1.6.1".to_string(),
192192
PythonPackage::MkdocsMaterial => "9.5.41".to_string(),
193193
PythonPackage::Mkdocstrings => "0.26.2".to_string(),
194-
PythonPackage::MyPy => "1.12.1".to_string(),
194+
PythonPackage::MyPy => "1.13.0".to_string(),
195195
PythonPackage::PreCommit => "4.0.0".to_string(),
196196
PythonPackage::Pytest => "8.3.3".to_string(),
197197
PythonPackage::PytestAsyncio => "0.24.0".to_string(),
@@ -203,7 +203,7 @@ pub fn default_version(package: &PythonPackage) -> String {
203203

204204
pub fn default_pre_commit_rev(hook: &PreCommitHook) -> String {
205205
match hook {
206-
PreCommitHook::MyPy => "v1.12.1".to_string(),
206+
PreCommitHook::MyPy => "v1.13.0".to_string(),
207207
PreCommitHook::PreCommit => "v5.0.0".to_string(),
208208
PreCommitHook::Ruff => "v0.7.0".to_string(),
209209
}

src/project_generator.rs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ fn build_latest_dev_dependencies(project_info: &ProjectInfo) -> Result<String> {
333333
for package in packages {
334334
match project_info.project_manager {
335335
ProjectManager::Poetry => {
336-
if package.package == PythonPackage::Tomli {
336+
if package.package == PythonPackage::MyPy {
337+
version_string.push_str(&format!(
338+
"{} = {{version = \"{}\", extras = [\"faster-cache\"]}}\n",
339+
package.package, package.version
340+
));
341+
} else if package.package == PythonPackage::Tomli {
337342
version_string.push_str(&format!(
338343
"{} = {{version = \"{}\", python = \"<3.11\"}}\n",
339344
package.package, package.version
@@ -349,7 +354,12 @@ fn build_latest_dev_dependencies(project_info: &ProjectInfo) -> Result<String> {
349354
}
350355
}
351356
ProjectManager::Uv | ProjectManager::Pixi => {
352-
if package.package == PythonPackage::Mkdocstrings {
357+
if package.package == PythonPackage::MyPy {
358+
version_string.push_str(&format!(
359+
" \"{}[faster-cache]=={}\",\n",
360+
package.package, package.version
361+
));
362+
} else if package.package == PythonPackage::Mkdocstrings {
353363
version_string.push_str(&format!(
354364
" \"{}[python]=={}\",\n",
355365
package.package, package.version
@@ -365,7 +375,12 @@ fn build_latest_dev_dependencies(project_info: &ProjectInfo) -> Result<String> {
365375
if let Some(pyo3_python_manager) = &project_info.pyo3_python_manager {
366376
match pyo3_python_manager {
367377
Pyo3PythonManager::Uv => {
368-
if package.package == PythonPackage::Mkdocstrings {
378+
if package.package == PythonPackage::MyPy {
379+
version_string.push_str(&format!(
380+
" \"{}[faster-cache]=={}\",\n",
381+
package.package, package.version
382+
));
383+
} else if package.package == PythonPackage::Mkdocstrings {
369384
version_string.push_str(&format!(
370385
" \"{}[python]=={}\",\n",
371386
package.package, package.version
@@ -378,7 +393,12 @@ fn build_latest_dev_dependencies(project_info: &ProjectInfo) -> Result<String> {
378393
}
379394
}
380395
Pyo3PythonManager::Setuptools => {
381-
if package.package == PythonPackage::Mkdocstrings {
396+
if package.package == PythonPackage::MyPy {
397+
version_string.push_str(&format!(
398+
"{}[faster-cachw]=={}\n",
399+
package.package, package.version
400+
));
401+
} else if package.package == PythonPackage::Mkdocstrings {
382402
version_string.push_str(&format!(
383403
"{}[python]=={}\n",
384404
package.package, package.version
@@ -396,7 +416,12 @@ fn build_latest_dev_dependencies(project_info: &ProjectInfo) -> Result<String> {
396416
}
397417
}
398418
ProjectManager::Setuptools => {
399-
if package.package == PythonPackage::Mkdocstrings {
419+
if package.package == PythonPackage::MyPy {
420+
version_string.push_str(&format!(
421+
"{}[faster-cache]=={}\n",
422+
package.package, package.version
423+
));
424+
} else if package.package == PythonPackage::Mkdocstrings {
400425
version_string.push_str(&format!(
401426
"{}[python]=={}\n",
402427
package.package, package.version

src/snapshots/python_project__project_generator__tests__create_pixi_pyproject_toml_mit_lib.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/project_generator.rs
33
expression: content
44
---
5-
"[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[project]\nname = \"my-project\"\ndescription = \"This is a test\"\nauthors = [\n { name = \"Arthur Dent\", email = \"[email protected]\" }\n]\nlicense = { file = \"LICENSE\" }\nreadme = \"README.md\"\nrequires-python = \">=3.9\"\ndynamic = [\"version\"]\ndependencies = []\n\n[tool.pixi.project]\nchannels = [\"conda-forge\", \"bioconda\"]\nplatforms = [\"linux-64\", \"osx-arm64\", \"osx-64\", \"win-64\"]\n\n[tool.pixi.feature.dev.tasks]\nrun-mypy = \"mypy my_project tests\"\nrun-ruff-check = \"ruff check my_project tests\"\nrun-ruff-format = \"ruff format my_project tests\"\nrun-pytest = \"pytest -x\"\n\n\n[project.optional-dependencies]\ndev = [\n \"mypy==1.12.1\",\n \"pre-commit==4.0.0\",\n \"pytest==8.3.3\",\n \"pytest-cov==5.0.0\",\n \"ruff==0.7.0\",\n]\n\n[tool.pixi.environments]\ndefault = {features = [], solve-group = \"default\"}\ndev = {features = [\"dev\"], solve-group = \"default\"}\n\n[tool.hatch.version]\npath = \"my_project/_version.py\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"
5+
"[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[project]\nname = \"my-project\"\ndescription = \"This is a test\"\nauthors = [\n { name = \"Arthur Dent\", email = \"[email protected]\" }\n]\nlicense = { file = \"LICENSE\" }\nreadme = \"README.md\"\nrequires-python = \">=3.9\"\ndynamic = [\"version\"]\ndependencies = []\n\n[tool.pixi.project]\nchannels = [\"conda-forge\", \"bioconda\"]\nplatforms = [\"linux-64\", \"osx-arm64\", \"osx-64\", \"win-64\"]\n\n[tool.pixi.feature.dev.tasks]\nrun-mypy = \"mypy my_project tests\"\nrun-ruff-check = \"ruff check my_project tests\"\nrun-ruff-format = \"ruff format my_project tests\"\nrun-pytest = \"pytest -x\"\n\n\n[project.optional-dependencies]\ndev = [\n \"mypy[faster-cache]==1.13.0\",\n \"pre-commit==4.0.0\",\n \"pytest==8.3.3\",\n \"pytest-cov==5.0.0\",\n \"ruff==0.7.0\",\n]\n\n[tool.pixi.environments]\ndefault = {features = [], solve-group = \"default\"}\ndev = {features = [\"dev\"], solve-group = \"default\"}\n\n[tool.hatch.version]\npath = \"my_project/_version.py\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"

src/snapshots/python_project__project_generator__tests__create_poetry_pyproject_toml_mit_lib.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/project_generator.rs
33
expression: content
44
---
5-
"[tool.poetry]\nname = \"my-project\"\nversion = \"0.1.7\"\ndescription = \"This is a test\"\nauthors = [\"Arthur Dent <[email protected]>\"]\nlicense = \"MIT\"\nreadme = \"README.md\"\n\n[tool.poetry.dependencies]\npython = \"^3.9\"\n\n[tool.poetry.group.dev.dependencies]\nmypy = \"1.12.1\"\npre-commit = \"4.0.0\"\npytest = \"8.3.3\"\npytest-cov = \"5.0.0\"\nruff = \"0.7.0\"\ntomli = {version = \"2.0.1\", python = \"<3.11\"}\n\n[build-system]\nrequires = [\"poetry-core>=1.0.0\"]\nbuild-backend = \"poetry.core.masonry.api\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"
5+
"[tool.poetry]\nname = \"my-project\"\nversion = \"0.1.7\"\ndescription = \"This is a test\"\nauthors = [\"Arthur Dent <[email protected]>\"]\nlicense = \"MIT\"\nreadme = \"README.md\"\n\n[tool.poetry.dependencies]\npython = \"^3.9\"\n\n[tool.poetry.group.dev.dependencies]\nmypy = {version = \"1.13.0\", extras = [\"faster-cache\"]}\npre-commit = \"4.0.0\"\npytest = \"8.3.3\"\npytest-cov = \"5.0.0\"\nruff = \"0.7.0\"\ntomli = {version = \"2.0.1\", python = \"<3.11\"}\n\n[build-system]\nrequires = [\"poetry-core>=1.0.0\"]\nbuild-backend = \"poetry.core.masonry.api\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"

src/snapshots/python_project__project_generator__tests__create_pyproject_toml_async_project.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/project_generator.rs
33
expression: content
44
---
5-
"[tool.poetry]\nname = \"my-project\"\nversion = \"0.1.7\"\ndescription = \"This is a test\"\nauthors = [\"Arthur Dent <[email protected]>\"]\nlicense = \"MIT\"\nreadme = \"README.md\"\n\n[tool.poetry.dependencies]\npython = \"^3.9\"\n\n[tool.poetry.group.dev.dependencies]\nmypy = \"1.12.1\"\npre-commit = \"4.0.0\"\npytest = \"8.3.3\"\npytest-asyncio = \"0.24.0\"\npytest-cov = \"5.0.0\"\nruff = \"0.7.0\"\ntomli = {version = \"2.0.1\", python = \"<3.11\"}\n\n[build-system]\nrequires = [\"poetry-core>=1.0.0\"]\nbuild-backend = \"poetry.core.masonry.api\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\nasyncio_mode = \"auto\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n \"ASYNC\", # flake8-async\n \n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"
5+
"[tool.poetry]\nname = \"my-project\"\nversion = \"0.1.7\"\ndescription = \"This is a test\"\nauthors = [\"Arthur Dent <[email protected]>\"]\nlicense = \"MIT\"\nreadme = \"README.md\"\n\n[tool.poetry.dependencies]\npython = \"^3.9\"\n\n[tool.poetry.group.dev.dependencies]\nmypy = {version = \"1.13.0\", extras = [\"faster-cache\"]}\npre-commit = \"4.0.0\"\npytest = \"8.3.3\"\npytest-asyncio = \"0.24.0\"\npytest-cov = \"5.0.0\"\nruff = \"0.7.0\"\ntomli = {version = \"2.0.1\", python = \"<3.11\"}\n\n[build-system]\nrequires = [\"poetry-core>=1.0.0\"]\nbuild-backend = \"poetry.core.masonry.api\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\nasyncio_mode = \"auto\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n \"ASYNC\", # flake8-async\n \n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"

src/snapshots/python_project__project_generator__tests__create_uv_pyproject_toml_mit_lib.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/project_generator.rs
33
expression: content
44
---
5-
"[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[project]\nname = \"my-project\"\ndescription = \"This is a test\"\nauthors = [\n { name = \"Arthur Dent\", email = \"[email protected]\" }\n]\nlicense = { file = \"LICENSE\" }\nreadme = \"README.md\"\nrequires-python = \">=3.9\"\ndynamic = [\"version\"]\ndependencies = []\n\n[tool.uv]\ndev-dependencies = [\n \"mypy==1.12.1\",\n \"pre-commit==4.0.0\",\n \"pytest==8.3.3\",\n \"pytest-cov==5.0.0\",\n \"ruff==0.7.0\",\n]\n\n[tool.hatch.version]\npath = \"my_project/_version.py\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"
5+
"[build-system]\nrequires = [\"hatchling\"]\nbuild-backend = \"hatchling.build\"\n\n[project]\nname = \"my-project\"\ndescription = \"This is a test\"\nauthors = [\n { name = \"Arthur Dent\", email = \"[email protected]\" }\n]\nlicense = { file = \"LICENSE\" }\nreadme = \"README.md\"\nrequires-python = \">=3.9\"\ndynamic = [\"version\"]\ndependencies = []\n\n[tool.uv]\ndev-dependencies = [\n \"mypy[faster-cache]==1.13.0\",\n \"pre-commit==4.0.0\",\n \"pytest==8.3.3\",\n \"pytest-cov==5.0.0\",\n \"ruff==0.7.0\",\n]\n\n[tool.hatch.version]\npath = \"my_project/_version.py\"\n\n[tool.mypy]\ncheck_untyped_defs = true\ndisallow_untyped_defs = true\n\n[[tool.mypy.overrides]]\nmodule = [\"tests.*\"]\ndisallow_untyped_defs = false\n\n[tool.pytest.ini_options]\nminversion = \"6.0\"\naddopts = \"--cov=my_project --cov-report term-missing --no-cov-on-fail\"\n\n[tool.coverage.report]\nexclude_lines = [\"if __name__ == .__main__.:\", \"pragma: no cover\"]\n\n[tool.ruff]\nline-length = 100\ntarget-version = \"py39\"\nfix = true\n\n[tool.ruff.lint]\nselect = [\n \"E\", # pycodestyle\n \"B\", # flake8-bugbear\n \"W\", # Warning\n \"F\", # pyflakes\n \"UP\", # pyupgrade\n \"I001\", # unsorted-imports\n \"T201\", # print found\n \"T203\", # pprint found\n]\nignore=[\n # Recommended ignores by ruff when using formatter\n \"E501\",\n \"W191\",\n \"E111\",\n \"E114\",\n \"E117\",\n \"D206\",\n \"D300\",\n \"Q000\",\n \"Q001\",\n \"Q002\",\n \"Q003\",\n \"COM812\",\n \"COM819\",\n \"ISC001\",\n \"ISC002\",\n]\n"

0 commit comments

Comments
 (0)