Skip to content

Commit

Permalink
Fix micropkg package
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
  • Loading branch information
astrojuanlu committed Jun 20, 2023
1 parent 05fca7b commit 4b360e1
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions kedro/framework/cli/micropkg.py
Expand Up @@ -662,19 +662,6 @@ def _drop_comment(line):
return line.partition(" #")[0]


def _make_install_requires(requirements_txt: Path) -> list[str]:
"""Parses each line of requirements.txt into a version specifier valid to put in
install_requires.
Matches pkg_resources.parse_requirements"""
if not requirements_txt.exists():
return []
return [
str(_EquivalentRequirement(_drop_comment(requirement_line)))
for requirement_line in requirements_txt.read_text().splitlines()
if requirement_line and not requirement_line.startswith("#")
]


def _create_nested_package(project: Project, package_path: Path) -> Path:
# fails if parts of the path exists already
packages = package_path.parts
Expand Down Expand Up @@ -838,9 +825,8 @@ def _generate_sdist_file(

# Build a setup.py on the fly
try:
install_requires = _make_install_requires(
metadata.project_path / "requirements.txt" # type: ignore
)
library_meta = project_wheel_metadata(metadata.project_path)
install_requires = _get_all_library_reqs(library_meta)
except Exception as exc:
click.secho("FAILED", fg="red")
cls = exc.__class__
Expand Down

0 comments on commit 4b360e1

Please sign in to comment.