diff --git a/RELEASE.md b/RELEASE.md index 4773f38ca5..6a82c79b57 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -13,6 +13,7 @@ ## Major features and improvements ## Bug fixes and other changes ## Breaking changes to the API +* `kedro package` does not produce `.egg` files anymore, and now relies exclusively on `.whl` files. ## Upcoming deprecations for Kedro 0.19.0 diff --git a/dependency/requirements.txt b/dependency/requirements.txt index 87535a356e..ad4e428f49 100644 --- a/dependency/requirements.txt +++ b/dependency/requirements.txt @@ -1,5 +1,6 @@ anyconfig~=0.10.0 attrs>=21.3 +build cachetools~=5.3 click<9.0 cookiecutter>=2.1.1, <3.0 diff --git a/docs/source/deployment/single_machine.md b/docs/source/deployment/single_machine.md index f47226bb57..0964a6a968 100644 --- a/docs/source/deployment/single_machine.md +++ b/docs/source/deployment/single_machine.md @@ -47,24 +47,18 @@ Run the following in your project’s root directory: kedro package ``` -Kedro builds the package into the `dist/` folder of your project, and creates one `.egg` file and one `.whl` file, which are [Python packaging formats for binary distribution](https://packaging.python.org/overview/). +Kedro builds the package into the `dist/` folder of your project, and creates a `.whl` file, which is [a Python packaging format for binary distribution](https://packaging.python.org/overview/). -The resulting `.egg` and `.whl` packages only contain the Python source code of your Kedro pipeline, not any of the `conf/` and `data/` subfolders nor the `pyproject.toml` file. +The resulting `.whl` package only contains the Python source code of your Kedro pipeline, not any of the `conf/` and `data/` subfolders nor the `pyproject.toml` file. The project configuration is packaged separately in a `tar.gz` file. This compressed version of the config files excludes any files inside your `local` directory. This means that you can distribute the project to run elsewhere, such as on a separate computer with different configuration, data and logging. When distributed, the packaged project must be run from within a directory that contains the `pyproject.toml` file and `conf/` subfolder (and `data/` if your pipeline loads/saves local data). This means that you will have to create these directories on the remote servers manually. -Recipients of the `.egg` and `.whl` files need to have Python and `pip` set up on their machines, but do not need to have Kedro installed. The project is installed to the root of a folder with the relevant `conf/` and `data/` subfolders, by navigating to the root and calling: +Recipients of the `.whl` file need to have Python and `pip` set up on their machines, but do not need to have Kedro installed. The project is installed to the root of a folder with the relevant `conf/` and `data/` subfolders, by navigating to the root and calling: ```console pip install ``` -Or when using the .egg file: - -```console -easy_install -``` - After having installed your project on the remote server, run the Kedro project as follows from the root of the project: ```console diff --git a/docs/source/development/commands_reference.md b/docs/source/development/commands_reference.md index 67663192b7..b5a2134f54 100644 --- a/docs/source/development/commands_reference.md +++ b/docs/source/development/commands_reference.md @@ -357,7 +357,7 @@ A parameterised run is best used for dynamic parameters, i.e. running the same p ### Deploy the project -The following packages your application as one `.egg` file and one `.whl` file within the `dist/` folder of your project. It packages the project configuration separately in a `tar.gz` file: +The following packages your application as one `.whl` file within the `dist/` folder of your project. It packages the project configuration separately in a `tar.gz` file: ```bash kedro package diff --git a/kedro/framework/cli/project.py b/kedro/framework/cli/project.py index 1167c44d90..73f4bfc912 100644 --- a/kedro/framework/cli/project.py +++ b/kedro/framework/cli/project.py @@ -148,28 +148,15 @@ def ipython( @project_group.command() @click.pass_obj # this will pass the metadata as first argument def package(metadata: ProjectMetadata): - """Package the project as a Python egg and wheel.""" + """Package the project as a Python wheel.""" source_path = metadata.source_dir call( [ sys.executable, - "setup.py", - "clean", - "--all", - "bdist_egg", - "--dist-dir", - "../dist", - ], - cwd=str(source_path), - ) - call( - [ - sys.executable, - "setup.py", - "clean", - "--all", - "bdist_wheel", - "--dist-dir", + "-m", + "build", + "--wheel", + "--outdir", "../dist", ], cwd=str(source_path), diff --git a/test_requirements.txt b/test_requirements.txt index 0f1055549b..cc448d41f7 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -17,7 +17,7 @@ gcsfs>=2023.1, <2023.3; python_version >= '3.8' geopandas>=0.6.0, <1.0 hdfs>=2.5.8, <3.0 holoviews~=1.13.0 -import-linter[toml]==1.2.6 +import-linter[toml]==1.8.0 ipython>=7.31.1, <8.0; python_version < '3.8' ipython~=8.10; python_version >= '3.8' isort~=5.0 diff --git a/tests/framework/cli/test_project.py b/tests/framework/cli/test_project.py index 5aae874485..92e0d024cd 100644 --- a/tests/framework/cli/test_project.py +++ b/tests/framework/cli/test_project.py @@ -296,23 +296,10 @@ def test_happy_path( mocker.call( [ sys.executable, - "setup.py", - "clean", - "--all", - "bdist_egg", - "--dist-dir", - "../dist", - ], - cwd=str(fake_repo_path / "src"), - ), - mocker.call( - [ - sys.executable, - "setup.py", - "clean", - "--all", - "bdist_wheel", - "--dist-dir", + "-m", + "build", + "--wheel", + "--outdir", "../dist", ], cwd=str(fake_repo_path / "src"),