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

Let poetry automatically pull version from tags #448

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
2 changes: 2 additions & 0 deletions docs/developer/devstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Setting up the development environment for Suzieq involves the following steps:
* Make sure you have a python3 version that is > 3.7.1 and less than 3.9.0. If you don't have a system provided python version that matches this requirement, you can use [pyenv](https://realpython.com/intro-to-pyenv/) to install one.
* If you've used pyenv to install a specific python version, ensure you activate it.
* Install poetry--follow the instructions posted [here](https://python-poetry.org/docs/#installation).
* Install *poetry-dynamic-versioning* -- follow the instructions posted
[here](https://pypi.org/project/poetry-dynamic-versioning/)
* Ensure you have git installed (follow the instructions [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git))
* Clone the github repository: ```git clone https://github.com/netenglabs/suzieq.git```. This creates a copy of the code repository in the subfolder suzieq in the current directory.
* Create the virtual environment and install the appropriate packages by typing: ```poetry install```
Expand Down
11 changes: 8 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "suzieq"
version = "0.16.0"
version = "0.0.0"
description = "A framework and application for network observability"
readme = 'README.md'
repository = 'https://github.com/netenglabs/suzieq'
Expand All @@ -14,7 +14,6 @@ classifiers = [
'Topic :: System :: Networking :: Monitoring'
]


[tool.poetry.dependencies]
python = ">3.7.1, < 3.9"
aiohttp = "==3.7.4"
Expand Down Expand Up @@ -74,6 +73,12 @@ sq-anonymizer = 'suzieq.utilities.sq_anonymizer:anonymizer_main'
suzieq-cli = 'suzieq.cli.sq_cli:cli_main'
suzieq-gui = 'suzieq.gui.sq_gui:gui_main'

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
style = "semver"
pattern = "^v(?P<base>\\d+\\.\\d+\\.\\d+)(-?((?P<stage>[a-zA-Z]+)\\.?(?P<revision>\\d+)?))?(\\+(?P<tagged_metadata>.+))?$"

[build-system]
requires = ["poetry>=0.12"]
requires = ["poetry>=1.0.2", "poetry-dynamic-versioning"]
build-backend = "poetry.masonry.api"
3 changes: 2 additions & 1 deletion suzieq/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python


SUZIEQ_VERSION = "0.16.0"
__version__ = "0.0.0"
SUZIEQ_VERSION = __version__
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept SUZIEQ_VERSION since I did not know if this module is being imported in other modules.


if __name__ == '__main__':
print(SUZIEQ_VERSION)