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

feat: config can load project name from pyproject.toml project setting #2461

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Jan 7, 2025

What I did

allow ape-config to use:

[project]
name = "myproject"

and use that as the project name so you don't necessarily have to do both configs (tool.ape as well)

How I did it

during config load from file, grab it.

How to verify it

make a project with pyproject.toml like

[project]
name = "myproject"
ape console -c "print(project.name)"
myproject

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

@antazoey antazoey changed the title feat: set name from project toml feat: config can load project name from pyproject.toml project setting Jan 7, 2025
@fubuloubu
Copy link
Member

What I did

allow ape-config to use:

[project]
name = "myproject"

This is the pyproject native name key?

config = pyproject_toml.get("tool", {}).get("ape", {})

# Utilize [project] for some settings.
if project_settings := pyproject_toml.get("project"):
Copy link
Member

Choose a reason for hiding this comment

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

Add a note that the Ape config value overrides whatever the root pyproject value is

Copy link
Member

Choose a reason for hiding this comment

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

*in the docs

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