Skip to content

Commit 5788319

Browse files
committed
Added information for how to enable git-hooks (see docs/enable_githooks.md) to automatically update the build number in version.py. Also updated docs/make_release.md to reflect changes to how version.py should be updated when making a release. Redefined build variable in version.py to be the commit number since the release of major.minor.micro with the appropriate tag.
1 parent e166861 commit 5788319

File tree

5 files changed

+20
-82
lines changed

5 files changed

+20
-82
lines changed

docs/enable_githooks.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Instructions for using git-hooks to automatically update FloPy `build` in `version.py`
2+
-----------------------------------------------
3+
4+
## Update files
5+
6+
1. Delete `pre-commit.sample` file in `.git/hooks`.
7+
2. Copy `pre-commit.sh` in root directory to `.git/hooks` directory.
8+
3. Remove `.sh` extension from `pre-commit.sh` in `.git/hooks` directory.
9+
4. Make sure `.git/hooks/pre-commit` is executable using `chmod +x .git/hooks/pre-commit`.
10+
11+
## Reset SourceTree to use system git
12+
13+
1. SourceTree will use git-hooks if the Embedded Git is git 2.9+. SourceTree version 2.5.3 uses git 2.10.0.
14+
2. If your version of SourceTree is using a version earlier than 2.9 then modify the SourceTree preferences to use the system version of git. All you have to do is got to `SourceTree -> Preferences -> Git` and choose `Use System Git` which can be found at `/usr/bin/git/`. See [https://medium.com/@onmyway133/sourcetree-and-pre-commit-hook-52545f22fe10](https://medium.com/@onmyway133/sourcetree-and-pre-commit-hook-52545f22fe10) for additional information.
15+

docs/make_release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Instructions for making a FloPy release
55

66
1. Update information in `.\docs\USGS_release.md`
77
2. Rename version number at top of `README.md` from FloPy Version 3.2.X-dev to FloPy Version 3.2.X.
8-
3. Update version number in `flopy/version.py`. Use GitHub website to determine what the next build number is for `__build__`
8+
3. Update version number in `flopy/version.py`. Update the `major`, `minor`, and/or `micro` variables as appropriate. The pre-commit hook will update the `build` variable to 0 since a `tag` has not been created for the release yet.
99

1010
## Build USGS release notes
1111

flopy/version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#flopy version file automatically created using...pre-commit.py
2-
# created on......July 12, 2017 15:44:05
2+
# created on......July 12, 2017 16:17:54
33

44
major = 3
55
minor = 2
66
micro = 6
7-
build = 75
7+
build = 76
88

9-
__version__= '3.2.6.75'
9+
__version__= '{:d}.{:d}.{:d}.{:d}'.format(major, minor, micro, build)

pre-commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def update_version():
7373
f.write('minor = {}\n'.format(vminor))
7474
f.write('micro = {}\n'.format(vmicro))
7575
f.write('build = {}\n\n'.format(vbuild))
76-
f.write("__version__= '{}'\n".format(v1))
76+
f.write("__version__= '{:d}.{:d}.{:d}.{:d}'.format(major, minor, micro, build)")
7777
f.close()
7878
print('Succesfully updated version.py')
7979
except:

updateversion.py

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)