Skip to content

Commit 61aa859

Browse files
authored
Merge pull request #1214 from wright-group/local-version
sanitize local version
2 parents d4cce82 + 290bef8 commit 61aa859

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
55

66
## [Unreleased]
77

8+
## Changed
9+
- local version identifier uses only ASCII letters/numbers and periods (PEP 440)
10+
811
## [3.6.0]
912

1013
### Added

WrightTools/__version__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
if p.exists():
3333
with open(str(p)) as f:
3434
__branch__ = f.readline().rstrip().split(r"/")[-1]
35-
__version__ += "+" + __branch__
35+
# clean local verson (PEP 440)
36+
__version__ += (
37+
f"+{''.join(char if (char.isalnum() or char=='.') else '.' for char in __branch__)}"
38+
)
3639
else:
3740
__branch__ = None

0 commit comments

Comments
 (0)