-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for scripts generated in build.py
- Loading branch information
Showing
6 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from pathlib import Path | ||
from setuptools.command.build_py import build_py | ||
|
||
|
||
class BuildPyCommand(build_py): | ||
def run(self): | ||
with open('script_generated/generated/file.py', 'w') as out: | ||
print("#!/bin/env python3\nprint('Success!')\n", file=out) | ||
return super().run() | ||
|
||
|
||
def build(setup_kwargs): | ||
setup_kwargs.update( | ||
{ | ||
"cmdclass": { | ||
"build_py": BuildPyCommand, | ||
}, | ||
"scripts": ["script_generated/generated/file.py"] | ||
} | ||
|
||
) |
16 changes: 16 additions & 0 deletions
16
tests/masonry/builders/fixtures/script_generated/pyproject.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[tool.poetry] | ||
name = "script_generated" | ||
version = "0.1" | ||
description = "" | ||
authors = ["Evgenii Gorchakov <[email protected]>", "Rob Taylor <[email protected]>"] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
|
||
[build-system] | ||
requires = ["poetry-core", "setuptools"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry.build] | ||
generate-setup-file = true | ||
script = "build.py" |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters