Skip to content

Commit

Permalink
Do not rely on setup.py to generate sdist
Browse files Browse the repository at this point in the history
See gh-2414.

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
  • Loading branch information
astrojuanlu committed May 30, 2023
1 parent 4f9be34 commit 922503e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions kedro/framework/cli/micropkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -775,9 +775,7 @@ def _generate_sdist_file(
raise KedroCliError(f"{cls.__module__}.{cls.__qualname__}: {exc}") from exc

_generate_manifest_file(temp_dir_path)
setup_file = _generate_setup_file(
package_name, version, install_requires, temp_dir_path
)
_generate_setup_file(package_name, version, install_requires, temp_dir_path)

package_file = destination / _get_sdist_name(name=package_name, version=version)

Expand All @@ -786,14 +784,14 @@ def _generate_sdist_file(
f"Package file {package_file} will be overwritten!", fg="yellow"
)

# python setup.py sdist --formats=gztar --dist-dir <destination>
# python -m build --outdir <destination>
call(
[
sys.executable,
str(setup_file.resolve()),
"sdist",
"--formats=gztar",
"--dist-dir",
"-m",
"build",
"--sdist",
"--outdir",
str(destination),
],
cwd=temp_dir,
Expand Down

0 comments on commit 922503e

Please sign in to comment.