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

Get the version dynamically from __init__.py #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ build-backend = "setuptools.build_meta"

[project]
name = "py-gcode-metadata"
version = "0.2.0dev"
description = "Python library for extraction of metadata from g-code files"
readme = {file = "README.md", content-type="text/markdown"}
license = {text = "LGPLv2+"}
Expand All @@ -31,6 +30,10 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]

dynamic = [
"version",
]

[project.urls]
"Homepage" = "https://github.com/prusa3d/gcode-metadata"
"Bug Tracker" = "https://github.com/prusa3d/gcode-metadata/issues"
Expand Down
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Setup of PrusaConnect SDK for Printer."""
import re

from setuptools import setup # type: ignore


Expand All @@ -8,9 +10,14 @@ def doc():
return readme.read().strip()


METADATA = {}
with open("gcode_metadata/__init__.py", "r", encoding="utf-8") as info:
METADATA = dict(re.findall(r'__([a-z_]+)__ = "([^"]+)"', info.read()))


setup(
name='py-gcode-metadata',
version='0.2.0dev',
version=METADATA["version"],
packages=['gcode_metadata'],
url='https://github.com/prusa3d/gcode-metadata',
license='LGPLv2+',
Expand Down