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

Add setuptools to pyproject.toml #3307

Merged
merged 2 commits into from
Oct 17, 2023

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Oct 13, 2023

This adds setuptools' schema to pyproject.toml, using a modified form from validate-pyproject used in setuptools itself.

This exposed a bug in the current test suite - tool.setuptools.packages.find.where must be an array. If you try to run it with the file (src/test/pyproject/simple.toml) as it exists in the current examples:

ValueError: invalid pyproject.toml config: `tool.setuptools.packages`.
configuration error: `tool.setuptools.packages` must be valid exactly by one definition (0 matches found):

    - type: array
      items:
        type: string
        at least one of the following:
          - {format: 'python-module-name'}
          - {format: 'pep561-stub-name'}
    - type: table
      additional keys: False
      keys:
        'find':
          type: table
          additional keys: False
          keys:
            'where':
              type: array
              items: {type: string}
            'exclude':
              type: array
              items: {type: string}
            'include':
              type: array
              items: {type: string}
            'namespaces': {type: boolean}


ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist

where = "src"
where = ["src"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a bug! Setuptools requires an array here.

Signed-off-by: Henry Schreiner <[email protected]>

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
@henryiii henryiii force-pushed the henryiii/feat/setuptools branch from 72d82e9 to 2e3f568 Compare October 16, 2023 13:48
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii
Copy link
Contributor Author

I discovered the "unknownFormats" field, which allows this to be closer to the upstream version.

@madskristensen madskristensen merged commit 7132aa1 into SchemaStore:master Oct 17, 2023
2 checks passed
@madskristensen
Copy link
Contributor

Thanks

@henryiii henryiii deleted the henryiii/feat/setuptools branch October 17, 2023 18:35
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