Skip to content

Commit

Permalink
export module version
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Nov 18, 2022
1 parent 62feb43 commit be5b284
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/analyst/src/index.js
Original file line number Diff line number Diff line change
@@ -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 },
Expand Down
21 changes: 16 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from setuptools.command.build_py import build_py
import subprocess
import warnings
import pathlib


LONG_DESCRIPTION = (
Expand All @@ -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:
Expand Down Expand Up @@ -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",
},
)

0 comments on commit be5b284

Please sign in to comment.