-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a few breaking changes in scripts
* Make sure we call os.path.expanduser() on pkg_dir * Try to guess project from setup.py instead of expecting it to be cloned in a specific way (that breaks in CI).
- Loading branch information
Showing
5 changed files
with
42 additions
and
7 deletions.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
scripts/__pycache__/ | ||
tests/__pycache__/ | ||
debhelper-build-stamp | ||
*.debhelper.log | ||
|
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
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,20 @@ | ||
""" | ||
Shared functions between various scripts | ||
""" | ||
import re | ||
from pathlib import Path | ||
|
||
RE_NAME = re.compile(r'name="(.*?)"') | ||
|
||
|
||
def project_name(path: Path) -> str: | ||
"""Extract the project name from setup.py""" | ||
setup_py = path / "setup.py" | ||
if not setup_py.exists(): | ||
raise RuntimeError(f"No setup.py in {path}." | ||
"If this isn't a Python project, use --project?") | ||
search = RE_NAME.search(setup_py.read_text()) | ||
if not search: | ||
raise RuntimeError(f"Unable to parse name out of {setup_py}. " | ||
"If this isn't a Python project, use --project?") | ||
return search.group(1) |
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