Skip to content

Commit

Permalink
added version code in setup
Browse files Browse the repository at this point in the history
  • Loading branch information
deepak7376 committed Jul 6, 2024
1 parent afe11e5 commit a11e37b
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
# setup.py
from setuptools import setup, find_packages
import subprocess
import os

# Get the version from git tags
version = (
subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE)
.stdout.decode("utf-8")
.strip()
)

if "-" in version:
v, i, s = version.split("-")
version = v + "+" + i + ".git." + s

assert "-" not in version
assert "." in version

# Write the version to a file
with open("VERSION", "w", encoding="utf-8") as fh:
fh.write("%s\n" % version)

# Read the long description from the README file
with open('README.md', encoding='utf-8') as f:
long_description = f.read()

setup(
name='wsn_sim',
version='0.1.0',
version=version,
description='Wireless Sensor Network Simulator with AODV and DSR protocols',
long_description=long_description,
long_description_content_type='text/markdown',
author='Deepak Yadav',
author_email='[email protected]',
url='https://github.com/deepak7376/wsn_sim',
Expand Down

0 comments on commit a11e37b

Please sign in to comment.