I need to get version value from setup.py or from PKG-INFO using bash and extract environment variable with the version value for later use. (Actually I need version value for GitHub Action)
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="helloworld",
version="0.0.3",
author="John",
author_email="john@gmail.com",
url="https://github.com/google/helloworld",
description="Hello World!",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires=["click"],
python_requires='>=3.6',
py_modules=["helloworld"],
entry_points={"console_scripts": ["helloworld = src.main:main"]},
)
PKG-INFO:
Metadata-Version: 2.1
Name: helloworld
Version: 0.0.3
Summary: Hello World!
Home-page: https://github.com/google/helloworld
Author: John
Author-email: john@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
# helloworld
Hello World Python
...