Skip to content

feat: support arbitrary path exports#38

Merged
BrandonLWhite merged 6 commits intopython-build-tools:mainfrom
ajaxbits:main
Feb 26, 2025
Merged

feat: support arbitrary path exports#38
BrandonLWhite merged 6 commits intopython-build-tools:mainfrom
ajaxbits:main

Conversation

@ajaxbits
Copy link
Contributor

@ajaxbits ajaxbits commented Feb 25, 2025

This will allow the user to specify arbitrary paths in the pyproject.toml file for the action to export in its project json object.

For example, if the pyproject.toml looks like:

[tool.poetry]
name = "single-project"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"

[tool.export.me.please]
foo = "bar"
true = true
one = 1


[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

And the user specified tool.export.me.please as the value for additional-export-paths, then the projects output for that project will look like:

{
  "buildBackend": "poetry.core.masonry.api",
  "commands": {
    "install": "poetry install",
  },
  "directory": "test-fixtures/project-with-exports",
  "name": "single-project",
  "path": "test-fixtures/project-with-exports/pyproject.toml",
  "pythonVersion": "^3.9",
  "exports": {
    "tool.export.me.please": {
      "foo": "bar",
      "one": 1,
      "true": true,
    }
  }
}

@ajaxbits ajaxbits marked this pull request as draft February 26, 2025 18:25
@ajaxbits ajaxbits force-pushed the main branch 18 times, most recently from 3853679 to 0076c22 Compare February 26, 2025 19:27
@ajaxbits ajaxbits marked this pull request as ready for review February 26, 2025 20:27
Copy link
Member

@BrandonLWhite BrandonLWhite 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 the contribution! This will be a very handy feature.

@BrandonLWhite BrandonLWhite merged commit d9aa80b into python-build-tools:main Feb 26, 2025
7 checks passed
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.

2 participants