Skip to content

Commit

Permalink
Use package.json to control python package version
Browse files Browse the repository at this point in the history
Signed-off-by: Jay Wang <[email protected]>
  • Loading branch information
xiaohk committed Jan 27, 2024
1 parent cb85137 commit 9592940
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
3 changes: 2 additions & 1 deletion notebook-widget/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif

recursive-include wizmap *
recursive-include wizmap *
include package.json
1 change: 1 addition & 0 deletions notebook-widget/package.json
20 changes: 10 additions & 10 deletions notebook-widget/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[bumpversion]
current_version = 0.1.2
commit = True
tag = True
# [bumpversion]
# current_version = 0.1.2
# commit = True
# tag = True

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
# [bumpversion:file:setup.py]
# search = version="{current_version}"
# replace = version="{new_version}"

[bumpversion:file:wizmap/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"
# [bumpversion:file:wizmap/__init__.py]
# search = __version__ = "{current_version}"
# replace = __version__ = "{new_version}"

[bdist_wheel]
universal = 1
Expand Down
13 changes: 11 additions & 2 deletions notebook-widget/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

"""The setup script."""

from json import loads
from json import loads, load
from setuptools import setup, find_packages
from pathlib import Path
import os

with open("README.md", "r") as readme_file:
readme = readme_file.read()
Expand All @@ -13,6 +14,14 @@

test_requirements = []

# Read the version from package.json
package_json_path = "./package.json"

# Read the package.json file
with open(package_json_path, "r", encoding="utf8") as f:
package_json = load(f)
version = package_json["version"]

setup(
author="Jay Wang",
author_email="[email protected]",
Expand Down Expand Up @@ -50,6 +59,6 @@
test_suite="tests",
tests_require=test_requirements,
url="https://github.com/poloclub/wizmap",
version="0.1.2",
version=version,
zip_safe=False,
)

0 comments on commit 9592940

Please sign in to comment.