-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix version bumping for pre-releases (#1610)
* Fix version bumping for pre-releases * Fix extra . * Set to 0.8.0.dev0 * Bump more files * Fix _version.py * Fix version_template * Add default value for release * Add hook to set the version in package.json * Install with dev in the check releaser workflow * Replace with `-dev`
- Loading branch information
Showing
13 changed files
with
60 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
version_info = (0, 8, 0, "dev") | ||
__version__ = '.'.join(map(str, version_info[:3])) + (("." + version_info[3]) if version_info[3] else "") | ||
version_info = (0, 8, 0, ".dev", "0") | ||
__version__ = ".".join(map(str, version_info[:3])) + "".join(version_info[3:]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,7 +63,9 @@ tests = | |
nbval | ||
requests-mock | ||
wheel | ||
dev = | ||
tbump | ||
toml | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
import toml | ||
|
||
ENC = dict(encoding="utf-8") | ||
ROOT = Path(__file__).parent.parent | ||
PYPROJECT = ROOT / "pyproject.toml" | ||
PACKAGE_JSON = ROOT / "package.json" | ||
|
||
|
||
def main(): | ||
# read the Python version | ||
pyproject = PYPROJECT.read_text(**ENC) | ||
data = toml.loads(pyproject) | ||
project = data.get("tool", {}).get("tbump", {}).get("version", {}) | ||
py_version = project.get("current") | ||
|
||
# set the JS version | ||
js_version = py_version.replace("a", "-alpha").replace("b", "-beta").replace("rc", "-rc").replace(".dev", "-dev") | ||
package_json = json.loads(PACKAGE_JSON.read_text(**ENC)) | ||
package_json["version"] = js_version | ||
PACKAGE_JSON.write_text(json.dumps(package_json, indent=2), **ENC) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |