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

Version handling #198

Merged
merged 25 commits into from Apr 2, 2020
Merged

Version handling #198

merged 25 commits into from Apr 2, 2020

Conversation

bjoernricks
Copy link
Member

@bjoernricks bjoernricks commented Apr 1, 2020

Checklist:

We are going to depend on packaging for converting to a PEP 440
compliant version.
Move a slightly modified version of get_version_from_pyproject_toml
function to the utils module.
The pyproject.toml file is **NOT** contained in the distributed python
package and therefore the version can't be loaded from the
pyproject.toml file at all.

As a result the version information must be set at two places

1. In the [tool.poetry] section of the pyproject.toml file
2. In a file within the installed and distributed python package
Convert verify-version.py into a more general utility to handle the
version information in python-gvm.
Allow to call the module via python -m
These function as version relates thus they should be in the new version
module.
Allow to reuse some of the code in external libraries and tools.
Also don't crash if version is not contained in [tool.poetry] section.
Rename check_version_is_pep440_compliant to is_version_pep440_compliant
and add a testcase.
Don't add extra spaces at the end of the generated __version__.py file.
tomlkit allos to preserver the current structure and layout when saving
the toml file.
Update the pyproject.toml version by reading and writing the file
directly instread of calling poetry update.
@codecov
Copy link

codecov bot commented Apr 1, 2020

Codecov Report

Merging #198 into master will decrease coverage by 3.81%.
The diff coverage is 51.4%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #198      +/-   ##
==========================================
- Coverage   91.59%   87.78%   -3.82%     
==========================================
  Files          12       14       +2     
  Lines        1047     1146      +99     
==========================================
+ Hits          959     1006      +47     
- Misses         88      140      +52
Impacted Files Coverage Δ
gvm/utils.py 100% <ø> (ø) ⬆️
gvm/__version__.py 100% <100%> (ø)
gvm/version.py 50.94% <50.94%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a85d62...9ce9410. Read the comment docs.

@bjoernricks bjoernricks marked this pull request as ready for review April 1, 2020 14:09
@bjoernricks bjoernricks merged commit 5358131 into greenbone:master Apr 2, 2020
@bjoernricks bjoernricks deleted the version-handling branch April 2, 2020 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants