Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate most project metadata to static pyproject.toml #2475

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

astrojuanlu
Copy link
Member

@astrojuanlu astrojuanlu commented Mar 28, 2023

Description

Address most of gh-2152, serve as a starting point for further efforts.

Development notes

Notice that https://github.com/asottile/setup-py-upgrade failed miserably, so I had to migrate everything manually. I followed these documentation pages:

Difference in RECORD (files included in the wheel):

--- dist/kedro-0.18.7.dist-info/RECORD  2023-03-28 13:25:06
+++ dist.new/kedro-0.18.7.dist-info/RECORD      2023-03-28 14:17:28
@@ -226,7 +226,7 @@
 kedro/templates/project/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/settings.py,sha256=q0VKI34mgwPjO8haQxe-g7--JOfIDqOmQE45nFZgCGw,1404
 kedro/templates/project/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
 kedro-0.18.7.dist-info/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
-kedro-0.18.7.dist-info/METADATA,sha256=JC0JdOUpqIpBexVo4zSFYSnZxhmqfA_2sWrNpMQuFT0,22394
+kedro-0.18.7.dist-info/METADATA,sha256=6ZxF7jm9LdeJThv_9ltNN-j2DPUuSembpqFgE2Fu9QA,22559
 kedro-0.18.7.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
 kedro-0.18.7.dist-info/entry_points.txt,sha256=OF35pWWHfRGXHdzr-DaEmh0o--JJoDEYvCIj9SSOD2I,51
 kedro-0.18.7.dist-info/top_level.txt,sha256=bHxaOZMJRvpgZkKzC7KHmu3BpX__YnayaMbuqsSN_es,6

differences in METADATA:

--- dist/kedro-0.18.7.dist-info/METADATA        2023-03-28 13:25:04
+++ dist.new/kedro-0.18.7.dist-info/METADATA    2023-03-28 14:17:28
@@ -2,16 +2,19 @@
 Name: kedro
 Version: 0.18.7
 Summary: Kedro helps you build production-ready data and analytics pipelines
-Home-page: https://github.com/kedro-org/kedro
 Author: Kedro
 License: Apache Software License (Apache 2.0)
+Project-URL: Homepage, https://kedro.org
+Project-URL: Source, https://github.com/kedro-org/kedro
+Project-URL: Documentation, https://docs.kedro.org
+Project-URL: Tracker, https://github.com/kedro-org/kedro/issues
 Keywords: pipelines,machine learning,data pipelines,data science,data engineering
 Classifier: Development Status :: 4 - Beta
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
 Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
-Requires-Python: >=3.7, <3.11
+Requires-Python: <3.11,>=3.7
 Description-Content-Type: text/markdown
 License-File: LICENSE.md
 Requires-Dist: anyconfig (~=0.10.0)

So, I'm quite confident that this is correct.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes

@merelcht
Copy link
Member

merelcht commented Mar 28, 2023

I'd suggest adding @SajidAlamQB and @AhdraMeraliQB as reviewers, because they're leading the complete Move to pyproject.toml package definition format milestone

Copy link
Contributor

@antonymilne antonymilne left a comment

Choose a reason for hiding this comment

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

This is great! And really nice way of checking it all worked as expected using diff 👍

Comment on lines -18 to -26
# get package version
with open(path.join(here, name, "__init__.py"), encoding="utf-8") as f:
result = re.search(r'__version__ = ["\']([^"\']+)', f.read())

if not result:
raise ValueError("Can't find the version in kedro/__init__.py")

version = result.group(1)

Copy link
Contributor

Choose a reason for hiding this comment

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

So pleased to see the back of this 😀

[tool.setuptools.dynamic]
readme = {file = "README.md", content-type = "text/markdown"}
version = {attr = "kedro.__version__"}
dependencies = {file = "dependency/requirements.txt"}
Copy link
Contributor

Choose a reason for hiding this comment

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

@astrojuanlu How does pyproject.toml handle the tests' requirements?

Copy link
Member Author

Choose a reason for hiding this comment

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

Test requirements don't exist anymore, they're replaced by the optional-dependencies (extras_requires in setuptools)

Copy link
Contributor

@AhdraMeraliQB AhdraMeraliQB left a comment

Choose a reason for hiding this comment

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

Thanks for taking this on! 🌟

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
See gh-2152.

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
@astrojuanlu astrojuanlu merged commit ebfed0c into main Apr 3, 2023
@astrojuanlu astrojuanlu deleted the static-metadata branch April 3, 2023 11:23
MaximeSteinmetz pushed a commit to MaximeSteinmetz/kedro that referenced this pull request Apr 3, 2023
)

* Remove deprecated tests_require

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Migrate most project metadata to static pyproject.toml

See kedro-orggh-2152.

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Replace direct setup.py invokations by standard command

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

---------

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
Signed-off-by: MaximeSteinmetz <maxime.steinmetz@gadz.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants