Allow passing build args via environment
Modern package build process _really_ doesn't want to let you
pass custom options to `setup.py` commands, so avoid all that hassle by
also checking the environment variables.
@@ -349,12 +349,25 @@ class build(distutils_build.build):
def finalize_options(self):
super().finalize_options()
+ if self.pg_config is None:
+ self.pg_config = os.environ.get("EDGEDB_BUILD_PG_CONFIG")
+ if self.runstatedir is None:
+ self.runstatedir = os.environ.get("EDGEDB_BUILD_RUNSTATEDIR")
+ if self.shared_dir is None:
+ self.shared_dir = os.environ.get("EDGEDB_BUILD_SHARED_DIR")
+ if self.version_suffix is None:
+ self.version_suffix = os.environ.get("EDGEDB_BUILD_VERSION_SUFFIX")
def run(self, *args, **kwargs):
super().run(*args, **kwargs)
build_lib = pathlib.Path(self.build_lib)
_compile_parsers(build_lib)
- if self.pg_config:
+ if (
+ self.pg_config
+ or self.runstatedir
+ or self.shared_dir
+ or self.version_suffix
+ ):
_compile_build_meta(
build_lib,
self.distribution.metadata.version,
