-
Notifications
You must be signed in to change notification settings - Fork 383
build: migrate from setup.py to pyproject.toml #1458
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ffaa9bb
从setup迁移至toml
lixiname fe7bce0
完成了从setup->toml的迁移
lixiname a78d344
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a6e02db
finish updating to pyproject.toml
minrk 0fad1b6
only install repo2docker itself
minrk 6879944
invoke setuptools_scm to get version
minrk 12df2be
Merge branch 'main' into main
minrk 0024f21
invoke setuptools_scm to get version
minrk f82d077
address review
minrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| [build-system] | ||
| requires = ["setuptools>=61.0", "wheel", "setuptools-scm"] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "jupyter-repo2docker" | ||
| dynamic = ["version"] | ||
| description = "Repo2docker: Turn code repositories into Jupyter enabled Docker Images" | ||
| readme = "README.md" | ||
| license = {text = "BSD"} | ||
| authors = [ | ||
| {name = "Project Jupyter Contributors", email = "[email protected]"} | ||
| ] | ||
| maintainers = [ | ||
| {name = "Project Jupyter Contributors", email = "[email protected]"} | ||
| ] | ||
| keywords = ["reproducible", "science", "environments", "docker"] | ||
| classifiers = [ | ||
| "Development Status :: 4 - Beta", | ||
| "Environment :: Console", | ||
| "Intended Audience :: Developers", | ||
| "Intended Audience :: System Administrators", | ||
| "Intended Audience :: Science/Research", | ||
| "License :: OSI Approved :: BSD License", | ||
| "Programming Language :: Python", | ||
| "Programming Language :: Python :: 3", | ||
| "Programming Language :: Python :: 3.9", | ||
| "Programming Language :: Python :: 3.10", | ||
| "Programming Language :: Python :: 3.11", | ||
| "Programming Language :: Python :: 3.12", | ||
| "Topic :: Scientific/Engineering", | ||
| "Topic :: Software Development", | ||
| "Topic :: System :: Systems Administration", | ||
| ] | ||
| requires-python = ">=3.9" | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| dependencies = [ | ||
| "chardet", | ||
| "docker!=5.0.0", | ||
minrk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "entrypoints", | ||
| "escapism", | ||
| "iso8601", | ||
| "jinja2", | ||
| "python-json-logger", | ||
| "requests", | ||
| "ruamel.yaml>=0.15", | ||
| "semver", | ||
| "toml", | ||
| "traitlets", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://repo2docker.readthedocs.io/en/latest/" | ||
| Documentation = "https://repo2docker.readthedocs.io" | ||
| Funding = "https://jupyter.org/about" | ||
minrk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Source = "https://github.com/jupyterhub/repo2docker/" | ||
| Tracker = "https://github.com/jupyterhub/repo2docker/issues" | ||
|
|
||
| [project.scripts] | ||
| jupyter-repo2docker = "repo2docker.__main__:main" | ||
| repo2docker = "repo2docker.__main__:main" | ||
|
|
||
| [project.entry-points."repo2docker.engines"] | ||
| docker = "repo2docker.docker:DockerEngine" | ||
|
|
||
| [tool.setuptools] | ||
| include-package-data = true | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["."] | ||
|
|
||
|
|
||
| [tool.wheel] | ||
| universal = 1 | ||
|
|
||
|
|
||
| [tool.setuptools_scm] | ||
| # 这个配置会让 setuptools-scm 自动创建一个 my_awesome_project/_version.py 文件, | ||
minrk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # 并在里面写入版本号。这样你的项目代码在运行时可以通过 my_awesome_project._version | ||
| # 来获取自身的版本。 | ||
| write_to = "repo2docker/_version.py" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| from ._version import get_versions | ||
|
|
||
| __version__ = get_versions()["version"] | ||
| del get_versions | ||
|
|
||
| from . import _version | ||
| from ._version import __version__ | ||
| from .app import Repo2Docker | ||
|
|
||
| __version__ = _version.get_versions()["version"] | ||
| # You can add this if you want an __all__ variable to control imports | ||
| __all__ = ["__version__", "Repo2Docker"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import tomllib | ||
minrk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| from setuptools.config.pyprojecttoml import read_configuration | ||
|
|
||
| if __name__ == "__main__": | ||
| try: | ||
| with open("pyproject.toml", "rb") as f: | ||
| tomllib.load(f) | ||
| print("✅ TOML语法正确") | ||
minrk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| except Exception as e: | ||
| print(f"❌ TOML语法错误: {e}") | ||
|
|
||
| try: | ||
| config = read_configuration("pyproject.toml") | ||
| print("✅ 配置文件语法正确") | ||
| print("项目名称:", config.get("name")) | ||
| except Exception as e: | ||
| print("❌ 配置错误:", e) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.