Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions pyproject.toml
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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace Repo2docker with repo2docker

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"
dependencies = [
"chardet",
"docker!=5.0.0",
"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"
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 文件,
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove comments

# 并在里面写入版本号。这样你的项目代码在运行时可以通过 my_awesome_project._version
# 来获取自身的版本。
write_to = "repo2docker/_version.py"
10 changes: 3 additions & 7 deletions repo2docker/__init__.py
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"]
18 changes: 18 additions & 0 deletions test_setuptools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import tomllib
Copy link
Contributor

Choose a reason for hiding this comment

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

tomllib requires Python 3.11. This might be the reason that all tests are failing.


from setuptools.config.pyprojecttoml import read_configuration

if __name__ == "__main__":
try:
with open("pyproject.toml", "rb") as f:
tomllib.load(f)
print("✅ TOML语法正确")
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the Chinese text be translated into English?

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)
Loading