-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
IN_ENV := . .venv/bin/activate; | ||
|
||
env: | ||
python3 -m venv .venv | ||
|
||
check_version_increase: | ||
$(IN_ENV) pip uninstall -y yinstruments | ||
$(IN_ENV) pip install yinstruments | ||
$(IN_ENV) echo `python print_version.py` > pypi_version.txt | ||
$(IN_ENV) pip uninstall -y yinstruments | ||
$(IN_ENV) pip install .. | ||
$(IN_ENV) echo `python print_version.py` > current_version.txt | ||
$(IN_ENV) pip uninstall -y yinstruments | ||
$(IN_ENV) python compare_versions.py pypi_version.txt current_version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import sys | ||
from packaging import version | ||
|
||
pypi_version_path = sys.argv[1] | ||
this_version_path = sys.argv[2] | ||
|
||
pypi_version = version.parse(open(pypi_version_path).read()) | ||
this_version = version.parse(open(this_version_path).read()) | ||
|
||
if this_version <= pypi_version: | ||
raise Exception( | ||
f"This version ({this_version}) is not greater than the pypi version ({pypi_version})" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import pkg_resources # part of setuptools | ||
|
||
version = pkg_resources.require("yaccounts")[0].version | ||
print(version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Versioning Check | ||
|
||
on: | ||
pull_request: | ||
|
||
|
||
jobs: | ||
version_check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Environment | ||
run: cd .github && make env | ||
|
||
- name: Check version increase | ||
run: cd .github && make check_version_increase | ||
|