Skip to content

Commit

Permalink
Make sure to always build the assets when building a python package
Browse files Browse the repository at this point in the history
  • Loading branch information
specialunderwear committed May 15, 2024
1 parent c429949 commit cfd2727
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@
"""
import os
import re
import subprocess
import sys

# pylint: disable=deprecated-module
from distutils.command import build as build_module

from setuptools import setup, find_packages

PROJECT_DIR = os.path.dirname(__file__)

sys.path.append(os.path.join(PROJECT_DIR, "src"))
from oscar import get_version # noqa isort:skip


class BuildNPM(build_module.build):
def run(self):
subprocess.check_call(["npm", "install"])
subprocess.check_call(["npm", "run", "build"])
super().run()


install_requires = [
"setuptools>=51.3.3",
"django>=3.2,<4.3",
Expand Down Expand Up @@ -88,8 +100,8 @@
license="BSD",
platforms=["linux"],
include_package_data=True,
package_dir={'': 'src'},
packages=find_packages('src'),
package_dir={"": "src"},
packages=find_packages("src"),
python_requires=">=3.8",
install_requires=install_requires,
extras_require={
Expand All @@ -98,6 +110,7 @@
"sorl-thumbnail": [sorl_thumbnail_version],
"easy-thumbnails": [easy_thumbnails_version],
},
cmdclass={"build": BuildNPM},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
Expand Down

0 comments on commit cfd2727

Please sign in to comment.