Skip to content

Read Version Number from the Package in setup.cfg #2530

@ChihweiLHBird

Description

@ChihweiLHBird

Hi,

I am trying to make a project to be setup.cfg project. In the old version, we letted the setup.py read a version number from a file inside the package.

def get_version() -> dict:
    version = {}
    with open(Path(__file__).parent / 'sciunit' / 'version.py') as f:
        exec(f.read(), version)
    return version['__version__']

setup(
    ...
    version=get_version(),
    ...
    )

I am wondering how can I achieve the same thing in setup.cfg file? Is it possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions