Skip to content

Conversation

@pvital
Copy link
Member

@pvital pvital commented May 3, 2024

This PR suggests changing the current build and package files to the latest standard Python building system. It prevents issues with the Instana package not being installed or built if the package wheel is not installed in the running environment (see pypa/pip#8559), which is common in fresh environments with recent pip versions.

To solve that, the suggestion is to use pyproject.toml instead of setup.py as building and packaging files. PEP 621 and PEP 631 standardized pyproject.toml as the new normal for Python packages instead of setup.py. PEP 517 and PEP 660 created standards for Python build systems.

This PR:

  1. moves all the Instana package files under the src directory;
  2. removes the setup.py; and
  3. creates the pyproject. toml file to be the new build and package file.

The new pyproject. toml file uses Hatchling as the default build-backend, and it must be installed in your system to build the package.

brew install hatch    # or from https://hatch.pypa.io/latest/install/#build-system-availability
hatch --version        # to verify the installation
hatch build 

@pvital pvital requested review from Ferenc- and GSVarsha May 3, 2024 14:38
@pvital pvital force-pushed the build_migration_to_pyproject.toml branch from d4f984f to cebb8e2 Compare May 3, 2024 15:02
To follow the new build system standardized by PEP 517 and PEP 660, this
commit changes the production code to be under the `src` directory and
has a cleaner project structure.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
@pvital pvital force-pushed the build_migration_to_pyproject.toml branch from cebb8e2 to 8891376 Compare May 22, 2024 13:35
@pvital pvital requested review from Ferenc- and GSVarsha May 22, 2024 13:40
PEP 621 and PEP 631 standardized `pyproject.toml` as the new normal for
Python packages instead of `setup.py`. PEP 517 and PEP 660 created
standards for Python build systems.

This commit removes the `setup.py` file and creates a `pyproject.toml`
one to deal with the new packaging standards.

Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
@pvital pvital force-pushed the build_migration_to_pyproject.toml branch from 8891376 to 58c3580 Compare May 23, 2024 07:13
@pvital pvital requested a review from Ferenc- May 23, 2024 07:14
Copy link
Member

@Ferenc- Ferenc- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pvital pvital merged commit c222d96 into master May 23, 2024
@pvital pvital deleted the build_migration_to_pyproject.toml branch May 23, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants