Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use path in setupbase.py #13168

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion setupbase.py
Expand Up @@ -17,6 +17,7 @@
import sys
from glob import glob
from logging import log
from pathlib import Path

from setuptools import Command
from setuptools.command.build_py import build_py
Expand All @@ -38,6 +39,7 @@
repo_root = os.path.dirname(os.path.abspath(__file__))

def execfile(fname, globs, locs=None):
fname = Path(fname)
locs = locs or globs
with open(fname) as f:
exec(compile(f.read(), fname, "exec"), globs, locs)
Expand Down Expand Up @@ -262,7 +264,7 @@ def run(self):
name, entrypt = script.split('=')
name = name.strip()
entrypt = entrypt.strip()
outfile = os.path.join(self.build_dir, name)
outfile = Path(os.path.join(self.build_dir, name))
heksadecimal marked this conversation as resolved.
Show resolved Hide resolved
outfiles.append(outfile)
print('Writing script to', outfile)

Expand Down Expand Up @@ -388,6 +390,7 @@ def _record_commit(self, base_dir):
repo_commit = repo_commit.strip().decode("ascii")

out_pth = pjoin(base_dir, pkg_dir, 'utils', '_sysinfo.py')
out_pth = Path(out_pth)
if os.path.isfile(out_pth) and not repo_commit:
heksadecimal marked this conversation as resolved.
Show resolved Hide resolved
# nothing to write, don't clobber
return
Expand Down