Skip to content

Commit b835221

Browse files
committed
chore: make building explicitly wipe objects to ensure it's regenerated
Signed-off-by: Brian Harring <ferringb@gmail.com>
1 parent 70da309 commit b835221

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

py_build.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@ def write_const(cleanup_files):
4545
)
4646

4747

48+
def get_objects_path():
49+
return Path.cwd() / "src/pkgcheck/_objects.py"
50+
51+
52+
def wipe_objects_on_disk():
53+
get_objects_path().unlink(missing_ok=True)
54+
55+
4856
def write_objects(cleanup_files):
49-
cleanup_files.append(path := Path.cwd() / "src/pkgcheck/_objects.py")
57+
cleanup_files.append(path := get_objects_path())
5058
print(f"writing objects to {path}")
5159

5260
with sys_path():
@@ -96,6 +104,9 @@ def write_files(cleanup_files):
96104

97105
@contextmanager
98106
def create_generated_files():
107+
# the objects registry isn't hot reloadable, and it's fragile for wiping
108+
# it if it already loaded the _objects_file. Thus just shoot it first thing.
109+
wipe_objects_on_disk()
99110
cleanup_files = []
100111
try:
101112
write_verinfo(cleanup_files)

0 commit comments

Comments
 (0)