Skip to content

Commit

Permalink
Fix: Correct checking that versions in package and pyproject.toml are…
Browse files Browse the repository at this point in the history
… synced. (#24)

Signed-off-by: Caroline Russell <[email protected]>
  • Loading branch information
cerrussell authored Feb 23, 2024
1 parent 9e7ddce commit b210608
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Make sure version in atom_tools.__init__.py has been updated
run: |
version=$(python3 -c 'from atom_tools.__init__ import __version__; print(f"refs/tags/v{__version__}")')
if $version != ${{ github.ref }}; then
if $version != "${{ github.ref }}"; then
echo "Version in atom_tools.__init__.py has not been updated. $version != ${{ github.ref }}"
exit 1
fi
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,16 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Make sure versions are synced if PR or ref is tag
if: ${{ github.event_name == 'pull_request' || github.ref_type == 'tag' }}
shell: bash
run: |
init_version=$(head -n 4 atom_tools/__init__.py | tail -1 | cut -d"'" -f2)
toml_version=$(head -n 3 pyproject.toml | tail -1 | cut -d'"' -f2)
if [ "$init_version" != "$toml_version" ]; then
echo "Version in atom_tools.__init__.py does not match pyproject.toml."
exit 1
fi
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools
Expand Down
2 changes: 1 addition & 1 deletion atom_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
A cli, classes and functions for converting an atom slice to a different format
"""
__version__ = '0.1.2'
__version__ = '0.2.1'

0 comments on commit b210608

Please sign in to comment.