Skip to content
Browse files

Merge pull request #809 from readthedocs/agj/setup-webpack-commands

Add webpack commands into
  • Loading branch information...
agjohnson committed Oct 3, 2019
2 parents feb0beb + 6947fea commit ddf840cb7206d7c45270560f077b12daa147f915
Showing with 40 additions and 5 deletions.
  1. +5 −3 docs/contributing.rst
  2. +35 −2
@@ -94,9 +94,11 @@ To release a new version of the theme, core team will take the following steps:
(with regards to alpha release and development versions). The version
increment should reflect these releases and any potentially breaking changes.
#. Update the changelog (``docs/changelog.rst``) with the version information.
#. Run ``npm run build`` to rebuild all the theme assets.
#. Run ``python update_translations`` to compile new translation files and update Transifex
#. Commit that change.
#. Run ``python update_translations`` to compile new translation files
and update Transifex.
#. Run ``python build`` to rebuild all the theme assets and the Python
#. Commit these changes.
#. Tag the release in git: ``git tag $NEW_VERSION``.
#. Push the tag to GitHub: ``git push --tags origin``.
#. Upload the package to PyPI:
@@ -5,12 +5,43 @@

import os
import subprocess
import distutils.cmd
import setuptools.command.build_py
from io import open
from setuptools import setup

class WebpackBuildCommand(setuptools.command.build_py.build_py):

"""Prefix Python build with Webpack asset build"""

def run(self):
if not 'CI' in os.environ:['node_modules/.bin/webpack', '--config', ''], check=True)

class WebpackDevelopCommand(distutils.cmd.Command):

description = "Run Webpack dev server"

user_options = []

def initialize_options(self):

def finalize_options(self):

def run(self):
["node_modules/.bin/webpack-dev-server", "--open", "--config", ""],

class UpdateTranslationsCommand(distutils.cmd.Command):

description = "Run all localization commands"
@@ -47,8 +78,8 @@ def finalize_options(self):

def run(self):['tx', 'push', '--source'])['tx', 'pull'])['tx', 'push', '--source'], check=True)['tx', 'pull'], check=True)

@@ -63,6 +94,8 @@ def run(self):
'update_translations': UpdateTranslationsCommand,
'transifex': TransifexCommand,
'build_py': WebpackBuildCommand,
'watch': WebpackDevelopCommand,

0 comments on commit ddf840c

Please sign in to comment.
You can’t perform that action at this time.