Skip to content

Commit

Permalink
Revert "Don't require npm to build from source (readthedocs#1039)"
Browse files Browse the repository at this point in the history
This reverts commit c40686d.

This commit and the subsequent one broke the search bar on our hosted
documentation.

Signed-off-by: Paul Chaignon <[email protected]>
  • Loading branch information
pchaigno committed Mar 11, 2022
1 parent 1039caa commit 5863cc7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 55 deletions.
7 changes: 1 addition & 6 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
version: 2
python:
version: 3.8
version: 3.6
install:
- requirements: docs/requirements.txt
- method: pip
path: .

sphinx:
configuration: docs/conf.py
10 changes: 5 additions & 5 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ To release a new version of the theme, core team will take the following steps:
#. Update the changelog (``docs/changelog.rst``) with the version information.
#. Run ``python setup.py update_translations`` to compile new translation files
and update Transifex.
#. Run ``python setup.py build_assets`` to rebuild all the theme assets and the Python
#. Run ``python setup.py build`` to rebuild all the theme assets and the Python
package.
#. 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:

.. code:: console
.. code:: console
$ rm -rf dist/
$ python setup.py sdist bdist_wheel
$ twine upload --sign --identity [email protected] dist/*
$ rm -rf dist/
$ python setup.py sdist bdist_wheel
$ twine upload --sign --identity [email protected] dist/*
.. _PEP440: https://www.python.org/dev/peps/pep-0440/
14 changes: 4 additions & 10 deletions docs/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@ In your ``conf.py`` file:
.. note::

Adding this theme as an extension is what enables localization of theme
strings in your translated output. If these strings are not translated in
your output, either we lack the localized strings for your locale, or you
are using an old version of the theme.
Adding this theme as an extension is what enables localization of theme
strings in your translated output. If these strings are not translated in
your output, either we lack the localized strings for your locale, or you
are using an old version of the theme.

Via Git or Download
===================

.. warning::

Installing directly from the repo is deprecated.
Static assets won't be included in the repo in a future release.

Symlink or subtree the ``sphinx_rtd_theme/sphinx_rtd_theme`` repository into your documentation at
``docs/_themes/sphinx_rtd_theme`` then add the following two settings to your Sphinx
``conf.py`` file:
Expand Down
41 changes: 30 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 9 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,17 @@
"""

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

from setuptools import setup


class WebpackBuildCommand(distutils.cmd.Command):

description = "Generate static assets"

user_options = []

def initialize_options(self):
pass
class WebpackBuildCommand(setuptools.command.build_py.build_py):

def finalize_options(self):
pass
"""Prefix Python build with Webpack asset build"""

def run(self):
if not 'CI' in os.environ and not 'TOX_ENV_NAME' in os.environ:
Expand All @@ -41,6 +33,7 @@ def run(self):
else:
subprocess.run(['npm', 'install'], check=True)
subprocess.run(['node_modules/.bin/webpack', '--config', 'webpack.prod.js'], check=True)
setuptools.command.build_py.build_py.run(self)


class WebpackDevelopCommand(distutils.cmd.Command):
Expand Down Expand Up @@ -114,7 +107,7 @@ def run(self):
cmdclass={
'update_translations': UpdateTranslationsCommand,
'transifex': TransifexCommand,
'build_assets': WebpackBuildCommand,
'build_py': WebpackBuildCommand,
'watch': WebpackDevelopCommand,
},
zip_safe=False,
Expand Down Expand Up @@ -156,17 +149,12 @@ def run(self):
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Operating System :: OS Independent',
'Topic :: Documentation',
'Topic :: Software Development :: Documentation',
],
project_urls={
'Homepage': 'https://sphinx-rtd-theme.readthedocs.io/',
'Source Code': 'https://github.com/readthedocs/sphinx_rtd_theme',
'Issue Tracker': 'https://github.com/readthedocs/sphinx_rtd_theme/issues',
},
)
4 changes: 2 additions & 2 deletions sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

0 comments on commit 5863cc7

Please sign in to comment.