Skip to content

Commit

Permalink
Fix ./bin/bump version.py on macOS (handley-lab#356)
Browse files Browse the repository at this point in the history
* add empty string after -i for macOS sed

* bump version to 2.6.1

* take opportunity to put spaces around operators

* check platform

* bump version to 2.7.2

---------

Co-authored-by: Will Handley <[email protected]>
  • Loading branch information
AdamOrmondroyd and williamjameshandley authored Mar 2, 2024
1 parent 8132626 commit e5b3bdf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
anesthetic: nested sampling post-processing
===========================================
:Authors: Will Handley and Lukas Hergt
:Version: 2.7.1
:Version: 2.7.2
:Homepage: https://github.com/handley-lab/anesthetic
:Documentation: http://anesthetic.readthedocs.io/

Expand Down
2 changes: 1 addition & 1 deletion anesthetic/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.7.1'
__version__ = '2.7.2'
17 changes: 10 additions & 7 deletions bin/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@
micro = current_version.micro

if update_type == "micro":
micro+=1
micro += 1
elif update_type == "minor":
minor+=1
micro=0
minor += 1
micro = 0
elif update_type == "major":
major+=1
minor=0
micro=0
major += 1
minor = 0
micro = 0

new_version = version.parse(f"{major}.{minor}.{micro}")

for f in [vfile, README]:
run("sed", "-i", f"s/{current_version}/{new_version}/g", f)
if sys.platform == "darwin": # macOS sed requires empty string for backup
run("sed", "-i", "", f"s/{current_version}/{new_version}/g", f)
else:
run("sed", "-i", f"s/{current_version}/{new_version}/g", f)

run("git", "add", vfile, README)
run("git", "commit", "-m", f"bump version to {new_version}")

0 comments on commit e5b3bdf

Please sign in to comment.