From be5b284a7a6309e735e16d855fde773a8dce8ff6 Mon Sep 17 00:00:00 2001 From: "S. Andrew Sheppard" Date: Fri, 18 Nov 2022 05:58:54 -0600 Subject: [PATCH] export module version --- packages/analyst/src/index.js | 2 ++ setup.py | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/analyst/src/index.js b/packages/analyst/src/index.js index 6daf030..32a6cba 100644 --- a/packages/analyst/src/index.js +++ b/packages/analyst/src/index.js @@ -1,9 +1,11 @@ import * as components from './components/index'; import * as views from './views/index'; import * as icons from './icons'; +import version from './version'; const analyst = { name: 'analyst', + version, components: { ...components }, views: { ...views }, icons: { ...icons }, diff --git a/setup.py b/setup.py index f957af1..f1b9818 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ from setuptools.command.build_py import build_py import subprocess import warnings +import pathlib LONG_DESCRIPTION = ( @@ -13,6 +14,16 @@ class BuildJS(build_py): def run(self): try: + version = ( + pathlib.Path(__file__).parent + / "packages" + / "analyst" + / "src" + / "version.js" + ) + version.write_text( + f'export default "{self.distribution.get_version()}";' + ) subprocess.check_call(["npm", "install"]) subprocess.check_call(["npm", "run", "build"]) except BaseException as e: @@ -74,10 +85,10 @@ def readme(): ], cmdclass={"build_py": BuildJS}, project_urls={ - 'Homepage': 'https://django-rest-pandas.wq.io/', - 'Documentation': 'https://django-rest-pandas.wq.io/', - 'Source': 'https://github.com/wq/django-rest-pandas', - 'Release Notes': 'https://django-rest-pandas.wq.io/releases/', - 'Issues': 'https://github.com/wq/django-rest-pandas/issues', + "Homepage": "https://django-rest-pandas.wq.io/", + "Documentation": "https://django-rest-pandas.wq.io/", + "Source": "https://github.com/wq/django-rest-pandas", + "Release Notes": "https://django-rest-pandas.wq.io/releases/", + "Issues": "https://github.com/wq/django-rest-pandas/issues", }, )