本文整理汇总了Python中setuptools.command.sdist.sdist.make_release_tree函数的典型用法代码示例。如果您正苦于以下问题:Python make_release_tree函数的具体用法?Python make_release_tree怎么用?Python make_release_tree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了make_release_tree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_release_tree
def make_release_tree(self, base_dir, files):
"""
Create the files in subdir base_dir ready for packaging
After the normal make_release_tree ran, we insert shared_setup
and modify the to-be-packaged setup.py
"""
log.error("sdist make_release_tree original base_dir %s files %s" % (base_dir, files))
log.error("sdist from shared_setup %s current dir %s" % (__file__, os.getcwd()))
if os.path.exists(base_dir):
# no autocleanup?
# can be a leftover of earlier crash/raised exception
raise Exception("base_dir %s present. Please remove it" % base_dir)
sdist.make_release_tree(self, base_dir, files)
if __name__ == '__main__':
log.error('running shared_setup as main, not adding it to sdist')
else:
# use a new name, to avoid confusion with original
new_shared_setup = 'shared_setup_dist_only'
external_dir = 'external_dist_only'
self._mod_setup_py(base_dir, external_dir, new_shared_setup)
self._add_shared_setup(base_dir, external_dir, new_shared_setup)
示例2: make_release_tree
def make_release_tree(self, base_dir, files):
"""
Create the files in subdir base_dir ready for packaging
After the normal make_release_tree ran, we insert shared_setup
and modify the to-be-packaged setup.py
"""
log.info("sdist make_release_tree original base_dir %s files %s" % (base_dir, files))
log.info("sdist from shared_setup %s current dir %s" % (__file__, os.getcwd()))
if os.path.exists(base_dir):
# no autocleanup?
# can be a leftover of earlier crash/raised exception
raise Exception("base_dir %s present. Please remove it" % base_dir)
sdist.make_release_tree(self, base_dir, files)
# have to make sure setup.py is not a symlink
dest, code = self._copy_setup_py(base_dir)
if __name__ == '__main__':
log.info('running shared_setup as main, not adding it to sdist')
else:
# use a new name, to avoid confusion with original
self._mod_setup_py(dest, code)
self._add_shared_setup(base_dir)
# Add mandatory files
for fn in [LICENSE, README]:
self.copy_file(os.path.join(REPO_BASE_DIR, fn), os.path.join(base_dir, fn))
示例3: make_release_tree
def make_release_tree(self, base_dir, files):
sdist.make_release_tree(self, base_dir, files)
sdist_version_ini = os.path.join(base_dir, "version.ini")
if os.path.exists(sdist_version_ini):
os.unlink(sdist_version_ini)
shutil.copy(
os.path.join(THIS_DIRECTORY, "../../../version.ini"), sdist_version_ini)
示例4: make_release_tree
def make_release_tree(self, basedir, files):
clean_tables()
build_tables()
dirty = dirty_version()
sdist.make_release_tree(self, basedir, files)
if dirty:
discard_changes()
示例5: make_release_tree
def make_release_tree(self, base_dir, files):
print("in sdist_testimages.make_release_tree")
sdist.make_release_tree(self, base_dir, files)
for afile in self.to_remove:
dest = os.path.join(base_dir, afile)
if os.path.exists(dest):
os.unlink(dest)
示例6: make_release_tree
def make_release_tree(self, base_dir, files):
if 'flent/build_info.py' in files and not self.dry_run:
files = [f for f in files if f != 'flent/build_info.py']
_sdist.make_release_tree(self, base_dir, files)
rewrite_build_info(os.path.join(base_dir, 'flent/build_info.py'))
else:
_sdist.make_release_tree(self, base_dir, files)
示例7: make_release_tree
def make_release_tree (self, base_dir, files, ) :
sdist_orig.make_release_tree(self, base_dir, files, )
with file(os.path.join(base_dir, "__version__.py", ), "w", ) as f :
f.write(
"VERSION = \"%s\"" % getattr(self.distribution.metadata, "version", )
)
示例8: make_release_tree
def make_release_tree(self, basedir, files):
clean_tables()
build_tables()
dirty = dirty_version()
sdist.make_release_tree(self, basedir, files)
if dirty:
restore_version()
示例9: make_release_tree
def make_release_tree(self, *a, **kw):
dist_path = self.distribution.get_fullname()
sdist.make_release_tree(self, *a, **kw)
self.reinitialize_command('build_static', work_path=dist_path,
force=True)
self.run_command('build_static')
示例10: make_release_tree
def make_release_tree(self, base_dir, files):
orig_sdist.make_release_tree(self, base_dir, files)
# add additional dependecies in the required version
for name, tar_src in self.contrib:
tarball = tar_src.format(versions[name + '_version'])
print("Downloading and adding {} sources from {}".format(name, tarball))
subprocess.call('wget -O - -q {} | tar xz -C {} --one-top-level=contrib/{} --strip-components=1'.format(
tarball, base_dir, name), shell=True)
示例11: make_release_tree
def make_release_tree (self, base_dir, files):
_sdist.make_release_tree(self, base_dir, files)
orig = path.join('lib', 'git', '__init__.py')
assert path.exists(orig)
dest = path.join(base_dir, orig)
if hasattr(os, 'link') and path.exists(dest):
os.unlink(dest)
self.copy_file(orig, dest)
_stamp_version(dest)
示例12: make_release_tree
def make_release_tree(self, base_dir, files):
_sdist.make_release_tree(self, base_dir, files)
orig = path.join("git", "__init__.py")
assert path.exists(orig), orig
dest = path.join(base_dir, orig)
if hasattr(os, "link") and path.exists(dest):
os.unlink(dest)
self.copy_file(orig, dest)
_stamp_version(dest)
示例13: make_release_tree
def make_release_tree(self, base_dir, files):
_sdist.make_release_tree(self, base_dir, files)
# now locate _version.py in the new base_dir directory (remembering
# that it may be a hardlink) and replace it with an updated value
target_versionfile = os.path.join(base_dir, versionfile_source)
print("UPDATING %s" % target_versionfile)
os.unlink(target_versionfile)
with open(target_versionfile, "w") as f:
f.write(SHORT_VERSION_PY % self._versioneer_generated_versions)
示例14: make_release_tree
def make_release_tree(self, base_dir, files):
root = get_root()
cfg = get_config_from_root(root)
_sdist.make_release_tree(self, base_dir, files)
# now locate _version.py in the new base_dir directory
# (remembering that it may be a hardlink) and replace it with an
# updated value
target_versionfile = os.path.join(base_dir, cfg.versionfile_source)
print("UPDATING %s" % target_versionfile)
write_to_version_file(target_versionfile,
self._versioneer_generated_versions)
示例15: make_release_tree
def make_release_tree(self, *a, **kw):
dist_path = self.distribution.get_fullname()
sdist.make_release_tree(self, *a, **kw)
self.reinitialize_command('build_static', work_path=dist_path)
self.run_command('build_static')
with open(os.path.join(dist_path, 'sentry-package.json'), 'w') as fp:
json.dump({
'createdAt': datetime.datetime.utcnow().isoformat() + 'Z',
}, fp)