File tree Expand file tree Collapse file tree
{{cookiecutter.project_name}}
src/{{cookiecutter.project_name}} Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ description = "{{cookiecutter.description}}"
55authors = [
66 { name = " {{cookiecutter.author_name}}" },
77]
8- requires-python = " >={{cookiecutter.version}}"
8+ readme = " README.md"
9+ license = { file = " LICENSE" }
10+ requires-python = " >={{cookiecutter.python_version}}"
911dependencies = []
1012
1113[project .optional-dependencies ]
@@ -15,9 +17,6 @@ dev = [
1517 " pytest-cov==6.0.0" ,
1618]
1719
18- [tool .setuptools .packages .find ]
19- where = [" src" ]
20-
2120[build-system ]
22- requires = [" pip>=22.0 " , " setuptools>=61 " , " wheel " ]
23- build-backend = " setuptools.build_meta "
21+ requires = [" uv_build>=0.8.14,<0.9.0 " ]
22+ build-backend = " uv_build "
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+
4+ def add_one_file (input_file : Path ) -> list [int ]:
5+ """
6+ Example function that adds one to the input.
7+
8+ Args:
9+ input_file: The input file containing one integer per line.
10+
11+ Returns:
12+ A list of integers, one for each line in the input file.
13+ """
14+ with open (input_file , "r" ) as f :
15+ return [add_one (int (line .strip ())) for line in f ]
16+
17+
118def add_one (x : int ) -> int :
219 """
320 Example function that adds one to the input.
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+ import pytest
4+
5+
6+ @pytest .fixture
7+ def test_data_dir () -> Path :
8+ """
9+ Returns the path to the test data directory.
10+ """
11+ return Path (__file__ ).parent / "data"
Original file line number Diff line number Diff line change 1+ 1
2+ 2
3+ 3
Original file line number Diff line number Diff line change 1- from {{cookiecutter .project_name }}.add_one import add_one
1+ from {{cookiecutter .project_name }}.add_one import add_one , add_one_file
2+ from pathlib import Path
23
4+ def test_add_one_file (test_data_dir : Path ) -> None :
5+ """
6+ Test that the add_one_file function works correctly.
7+ """
8+ assert add_one_file (test_data_dir / "test_add_one" / "integers.txt" ) == [2 , 3 , 4 ]
39
4- def test_add_one ():
10+ def test_add_one () -> None :
511 """
612 Test that the add_one function works correctly.
713 """
You can’t perform that action at this time.
0 commit comments