-
Notifications
You must be signed in to change notification settings - Fork 439
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
Build JavaScript files during python package build #697
Conversation
That feels a bit too magic to me? Maybe just warn if the minified js files are not found. |
I wouldn't know what part should warn about these files missing. Since this step is required for building a working redistributable package (may it be a wheel or just a tarball) this looks like a good place to me. It also makes it obvious that you will need npm if you use The idea for this was actually taken from the readthedocs sphinx theme: |
Again, just my personal preference. I can see that your approach would solve a lot of annoying newbie issues. The primary reason for people to install from source is because the isso package in pypi has historically been outdated or even broken ( People installing directly via My favourite way to resolve this whole issue would be to keep minified versions of the js assets in this repo, but sadly that might break the (I guess your approach wouldn't affect FTBFS issues since you'd invoke the make commands in the "prepare" stage anyway, and not use python to generate the minified js assets?) |
setup.py
Outdated
|
||
def run(self): | ||
if 'TOX_ENV' not in os.environ: | ||
subprocess.run(['make', 'init', 'js'], check=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check_call() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Although subprocess.run(..., check=True)
does the same I find subprocess.check_call()
to be a bit more obvious and in fact know it from Python 2.7 already.
Rebased and applied the Sorry for the long delay, work and health kept me busy lately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve the conflict?
Make package builds via setuptools automatically trigger building of merged & minified JS assets. This fixes installing isso from source when using "pip install" as long as both the python and node requirements are met. It also ensures that setup.py commands like "build" or "bdist_wheel" create archives that contain generated JS code.
Note that packages created by |
…kage build (isso-comments#697)" This reverts commit bbad14e.
Feel free to revert, I don't need it myself and I don't intend to dive any further into the sorry state of python packaging |
Let's revert. |
Make package builds via setuptools automatically trigger building of
merged & minified JS assets.
This fixes installing isso from source when using
pip install
as longas both the python and node requirements are met. It also ensures that
setup.py
commands likebuild
orbdist_wheel
create archives thatcontain generated JS code.