I am trying to migrate my package from setup.py
to pyproject.toml
and I am not sure how to do the dynamic versioning in the same way as before. Currently I can pass the development version using environment variables when the build is for development.
The setup.py
file looks similar to this:
import os
from setuptools import setup
import my_package
if __name__ == "__main__":
dev_version = os.environ.get("DEV_VERSION")
version = dev_version if dev_version else f"{my_package.__version__}"
setup(
name="my_package",
version=version,
...
)
Is there a way to do similar thing when using pyproject.toml
file?