Files
sphinx_rtd_theme/setup.py
T
Anthony Johnson e4bcdd8c41 Bump to 1.0alpha1
I think we talked about this and never followed through on the next few
release, not sure though. After we release a new version, I think we should be updating
the repository version to something other than the most current release.

The effect would be that the version in the repository would be an
alpha/dev release, and so would be possible to differentiate easily
between 0.5.2 release on PyPI and 0.5.3alpha1 development release from Git.
Right now, we don't follow up with incrementing this version, and so
it's harder to tell the difference. This is mostly for our use in
development.

It adds a small bit of overhead, but is nice and explicit.

This PR updates the version in the repository to 1.0.0alpha1. If we had
adopted this workflow, the progression would have been:

* Release 0.5.2, open PR bumping to 0.5.2 (run `bump2version release` and open PR)
* Follow up 0.5.2 release by bumping to `0.5.3alpha1` (run `bump2version patch` and open PR)
* We add a new feature, bump to `0.6.0alpha1` (run `bump2version minor` and open PR)
* Oops, backwards incompatible change. We bump to `1.0.0alpha1` (run `bump2version major` and open PR)
* We're ready for an rc, bump to `1.0.0rc1` (run `bump2version release` and open PR)
* Maybe we cut another rc after some fixes
* We're ready for final release, bump to `1.0.0` (run `bump2version release` and open PR)
* Follow up the release PR by bumping to the next version (run `bump2version patch` and open PR)
2021-08-10 15:37:55 -06:00

158 lines
4.2 KiB
Python

# -*- coding: utf-8 -*-
import distutils.cmd
import os
import subprocess
from io import open
from setuptools import setup
class WebpackBuildCommand(distutils.cmd.Command):
description = "Generate static assets"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
if not 'CI' in os.environ and not 'TOX_ENV_NAME' in os.environ:
subprocess.run(['npm', 'install'], check=True)
subprocess.run(['node_modules/.bin/webpack', '--config', 'webpack.prod.js'], check=True)
class WebpackDevelopCommand(distutils.cmd.Command):
description = "Run Webpack dev server"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
subprocess.run(
["node_modules/.bin/webpack-dev-server", "--open", "--config", "webpack.dev.js"],
check=True
)
class UpdateTranslationsCommand(distutils.cmd.Command):
description = "Run all localization commands"
user_options = []
sub_commands = [
('extract_messages', None),
('update_catalog', None),
('transifex', None),
('compile_catalog', None),
]
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
for cmd_name in self.get_sub_commands():
self.run_command(cmd_name)
class TransifexCommand(distutils.cmd.Command):
description = "Update translation files through Transifex"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
subprocess.run(['tx', 'push', '--source'], check=True)
subprocess.run(['tx', 'pull', '--mode', 'onlyreviewed', '-f', '-a'], check=True)
setup(
name='sphinx_rtd_theme',
version='1.0.0alpha1',
url='https://github.com/readthedocs/sphinx_rtd_theme',
license='MIT',
author='Dave Snider, Read the Docs, Inc. & contributors',
author_email='dev@readthedocs.org',
description='Read the Docs theme for Sphinx',
long_description=open('README.rst', encoding='utf-8').read(),
cmdclass={
'update_translations': UpdateTranslationsCommand,
'transifex': TransifexCommand,
'build_assets': WebpackBuildCommand,
'watch': WebpackDevelopCommand,
},
zip_safe=False,
packages=['sphinx_rtd_theme'],
package_data={'sphinx_rtd_theme': [
'theme.conf',
'*.html',
'static/css/*.css',
'static/css/fonts/*.*',
'static/js/*.js',
]},
include_package_data=True,
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
entry_points = {
'sphinx.html_themes': [
'sphinx_rtd_theme = sphinx_rtd_theme',
]
},
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
install_requires=[
'sphinx>=1.6',
'docutils<0.17', # https://github.com/sphinx-doc/sphinx/issues/9001
],
tests_require=[
'pytest',
],
extras_require={
'dev': [
'transifex-client',
'sphinxcontrib-httpdomain',
'bump2version',
],
},
classifiers=[
'Framework :: Sphinx',
'Framework :: Sphinx :: Theme',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'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',
},
)