Commit b4333e45 by Sébastien Eustace

Fix sonnet script

parent d27ed443
......@@ -51,6 +51,7 @@ class MakeReleaseCommand(Command):
from poetry.repositories.repository import Repository
from poetry.utils._compat import Path
from poetry.utils.helpers import temporary_directory
from poetry.vcs import get_vcs
project = Poetry.create(Path.cwd())
package = project.package
......@@ -60,11 +61,21 @@ class MakeReleaseCommand(Command):
pool = Pool()
pool.add_repository(project.locker.locked_repository(with_dev_reqs=True))
vcs = get_vcs(Path(__file__).parent)
if vcs:
vcs_excluded = [str(f) for f in vcs.get_ignored_files()]
else:
vcs_excluded = []
with temporary_directory() as tmp_dir:
# Copy poetry to tmp dir
poetry_dir = os.path.join(tmp_dir, "poetry")
shutil.copytree(
os.path.join(os.path.dirname(__file__), "poetry"), poetry_dir
os.path.join(os.path.dirname(__file__), "poetry"),
poetry_dir,
ignore=lambda dir_, names: set(vcs_excluded).intersection(
set([os.path.join(dir_, name) for name in names])
),
)
for version, python in sorted(pythons.items()):
self.line(
......@@ -102,9 +113,14 @@ class MakeReleaseCommand(Command):
continue
path = os.path.join(os.path.realpath(root), f)
relpath = os.path.relpath(
path, os.path.realpath(tmp_dir)
)
if relpath in vcs_excluded:
continue
tar_info = tar.gettarinfo(str(path), arcname=relpath)
if tar_info.isreg():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment