File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,9 @@ def _create_package(self) -> None:
85
85
package_init_template = self .env .get_template ("package_init.pyi" )
86
86
package_init .write_text (package_init_template .render (description = self .package_description ))
87
87
88
+ pytyped = self .package_dir / "py.typed"
89
+ pytyped .write_text ("# Marker file for PEP 561" )
90
+
88
91
def _build_metadata (self ) -> None :
89
92
# Create a pyproject.toml file
90
93
pyproject_template = self .env .get_template ("pyproject.toml" )
Original file line number Diff line number Diff line change @@ -184,14 +184,21 @@ def test__create_package(self, mocker):
184
184
project .env = mocker .MagicMock ()
185
185
project .env .get_template .return_value = package_init_template
186
186
package_init_path = mocker .MagicMock (autospec = pathlib .Path )
187
- project .package_dir .__truediv__ .return_value = package_init_path
187
+ pytyped_path = mocker .MagicMock (autospec = pathlib .Path )
188
+ paths = {
189
+ "__init__.py" : package_init_path ,
190
+ "py.typed" : pytyped_path ,
191
+ }
192
+
193
+ project .package_dir .__truediv__ .side_effect = lambda x : paths [x ]
188
194
189
195
project ._create_package ()
190
196
191
197
project .package_dir .mkdir .assert_called_once ()
192
198
project .env .get_template .assert_called_once_with ("package_init.pyi" )
193
199
package_init_template .render .assert_called_once_with (description = project .package_description )
194
200
package_init_path .write_text .assert_called_once_with (package_init_template .render ())
201
+ pytyped_path .write_text .assert_called_once_with ("# Marker file for PEP 561" )
195
202
196
203
def test__build_metadata (self , mocker ):
197
204
from openapi_python_client import _Project
You can’t perform that action at this time.
0 commit comments