Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable publishing beta versions #32

Merged
merged 3 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ stages:
env:
NPM_TOKEN: $(NPM_TOKEN)

- script: |
latestGitTag=$(git describe --tags --abbrev=0)
latestGitTag="${latestGitTag:1}"
npm version $latestGitTag --no-commit-hooks --no-git-tag-version
displayName: 'Update package.json version'

- script: jlpm run build:prod
displayName: 'Build jupyterlab extension'
env:
Expand All @@ -149,10 +155,8 @@ stages:
displayName: 'Release to Pypi'

- script: |
currentVersion=$(./node_modules/.bin/git-tag-version)
latestGitTag=$(git describe --tags --abbrev=0)
latestGitTag="${latestGitTag:1}"
echo $currentVersion
echo $latestGitTag
if [[ $latestGitTag == *"beta"* ]];
then
Expand Down
3 changes: 2 additions & 1 deletion pybabylonjs/_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

# Copyright (c) TileDB, Inc..
# Distributed under the terms of the Modified BSD License.
from ._version import __npm_version__

"""
Information about the frontend package of the widgets.
"""

module_name = "@tiledb-inc/pybabylonjs"
module_version = ">=1.0.4"
module_version = __npm_version__
12 changes: 6 additions & 6 deletions pybabylonjs/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def _fetchVersion():
try:
with settings.open() as f:
version = json.load(f)["version"]
return (
version.replace("-alpha.", "a")
.replace("-beta.", "b")
.replace("-rc.", "rc")
)
return version
except FileNotFoundError:
pass

raise FileNotFoundError(f"Could not find package.json under dir {HERE!s}")


__version__ = _fetchVersion()
__npm_version__ = _fetchVersion()

__version__ = (
__npm_version__.replace("-alpha.", "a").replace("-beta.", "b").replace("-rc.", "rc")
)
13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
# Get the package info from package.json
pkg_json = json.loads((HERE / "package.json").read_bytes())

version = (
pkg_json["version"]
.replace("-alpha.", "a")
.replace("-beta.", "b")
.replace("-rc.", "rc")
)

setup_args = dict(
name=name,
use_scm_version={
"version_scheme": "guess-next-dev",
"local_scheme": "dirty-tag",
"write_to": "pybabylonjs/version.py",
},
version=version,
setup_requires=[
"setuptools-scm>=1.5.4",
"setuptools-scm-git-archive",
Expand Down