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

Add tests for 'ver' command #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 10 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
python --version
- name: Install miniver
run: |
pip install .
which miniver || exit 1
- name: Set up dummy Python project with miniver
run: |
cd ..
Expand All @@ -35,12 +39,17 @@ jobs:
pip install -e .
- name: Test versioning of dummy project
run: |
python -c "import my_package; assert my_package.__version__ == '0.0.0'"
cd ../my_package
python -c "import my_package; assert my_package.__version__ == '0.0.0'"
[[ $(miniver ver my_package) = "0.0.0" ]] || exit 1
echo "# Extra comment" >> setup.py
python -c "import my_package; assert my_package.__version__.endswith('dirty')"
[[ $(miniver ver my_package) =~ dirty$ ]] || exit 1
python -c "import my_package; assert my_package.__version__.startswith('0.0.0')"
[[ $(miniver ver my_package) =~ ^0\.0\.0 ]] || exit 1
git commit -a -m "new comment"
python -c "import my_package; assert my_package.__version__.startswith('0.0.0.dev1')"
[[ $(miniver ver my_package) =~ ^0\.0\.0\.dev1 ]] || exit 1
git tag -a 0.0.1 -m "0.0.1"
python -c "import my_package; assert my_package.__version__ == '0.0.1'"
[[ $(miniver ver my_package) = '0.0.1' ]] || exit 1