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

Use pyproject file for project metadata. #1865

Merged
merged 4 commits into from
Jan 5, 2024

Conversation

naschmitz
Copy link
Collaborator

Motivation:

  • Official Python support for packages using setup.py are in varying states of deprecation.
  • The Python packaging guide strongly recommends a pyproject.toml file.
  • Enables release automation not possible before (e.g. setuptools_scm).

Summary of changes:

  • Switches metadata to pyproject.toml instead of setup.py and setup.cfg files.
  • Upgraded bump2version (unmaintained) to bump-my-version.
    • Usage is similar. In command-line calls, replace bumpversion with bump-my-version.
  • Switched from flake8 to pyproject-flake8.
    • Usage is similar. In command-line calls, replace flake8 with pflake8.
  • Updated all the relevant documentation.

Copy link
Collaborator

@schwehr schwehr left a comment

Choose a reason for hiding this comment

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

One minor change and a few suggestions for follow on PRs

@@ -78,14 +78,14 @@ Ready to contribute? Here's how to set up _geemap_ for local development.
5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not for the commit, but setting up https://github.com/pre-commit/pre-commit or simillar would be a good idea to automate this kind of cleanup

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ack. Good idea!

readme = "README.rst"
requires-python = ">=3.8"
keywords = [
"geemap",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of scope for here, but the keyword list needs to be expanded

authors = [
{name = "Qiusheng Wu", email = "giswqs@gmail.com"},
]
classifiers = [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of scope for here, but the classifiers needs to be expanded

pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Member

@giswqs giswqs left a comment

Choose a reason for hiding this comment

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

@naschmitz Great work! I have many Python packages that also need the migration. This is a great example I can learn from. Thank you very much!

@giswqs giswqs merged commit 620c3f9 into gee-community:master Jan 5, 2024
13 checks passed
@giswqs
Copy link
Member

giswqs commented Jan 10, 2024

@naschmitz I just realized that the wheel generated by python -m build is missing the source file in it, causing the import geemap to fail. Not sure if we can modify the pyproject.toml to including the source files. Investigating.

image

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

3 participants