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

Huak's PyProjectToml implementation #852

Closed
Tracked by #602
cnpryer opened this issue Nov 16, 2023 · 0 comments · Fixed by #854
Closed
Tracked by #602

Huak's PyProjectToml implementation #852

cnpryer opened this issue Nov 16, 2023 · 0 comments · Fixed by #854
Assignees
Milestone

Comments

@cnpryer
Copy link
Owner

cnpryer commented Nov 16, 2023

Summary

Improve pyproject.toml management and robustness by implementing Huak's pyproject.toml library.

Motivation

The pyproject.toml is like the Cargo.toml of Rust. You're supposed to use Cargo to manage the manifest file (Cargo.toml). The goal would be to treat the pyproject.toml similarly with Huak.

Requirements

  • Simple API for read, write, etc.
  • Allow core pyproject.toml data and other tables (includes tool tables)
  • Make Git integration better with easier TOML ser.
  • Allow for workspace management

Details

Projects have manifest files named pyproject.toml (as specified in PEP 517). The data can consist of project metadata as well as tooling configuration. Here's Huak's pyproject.toml

[project]
name = "huak"
version = "0.0.20a1"
description = "A Python package manager written in Rust and inspired by Cargo."
authors = [
    {email = "[email protected]"},
    {name = "Chris Pryer"}
]
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.7"
classifiers = [
    "Programming Language :: Rust",
]

[project.urls]
issues = "https://github.com/cnpryer/huak/issues"
documentation = "https://github.com/cnpryer/huak"
homepage = "https://github.com/cnpryer/huak"
repository = "https://github.com/cnpryer/huak"

[tool.maturin]
bindings = "bin"
manifest-path = "crates/huak-cli/Cargo.toml"
module-name = "huak"
python-source = "python"
strip = true

[build-system]
requires = ["maturin>=0.14,<0.15"]
build-backend = "maturin"

[tool.huak]
toolchain = "default"

This manifest identifies the workspace for the Huak project. It contains metadata about the project, it's authors, build configuration, and config for other tools like maturin. At the bottom is the [tool.huak] table (see PEP 518).

[tool.huak]

Huak's pyproject.toml implementation needs to expect a tool table, especially Huak's tool table. See:

Example:

[tool.huak]
toolchain = "3.11.6"
repositories = { package = "url to repo" }  # TODO

[tool.huak.run]  # TODO: Compare with new project.run table.
hello-world = "python -c 'print('hello, world.')'"

[tool.huak.workspace]
members = ["projects/*"]
@cnpryer cnpryer self-assigned this Nov 16, 2023
@cnpryer cnpryer mentioned this issue Nov 16, 2023
28 tasks
@cnpryer cnpryer added this to the General-Use Release milestone Nov 16, 2023
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 a pull request may close this issue.

1 participant