Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a8c03fe

Browse files
remove build_sphinx and upload_docs, fixes #
build_sphinx is removed since sphinx 7. upload_docs does not work since long due to missing permissions, see python-llfuse#59. the removed fix_docutils bug workaround is not needed any more: sphinx-doc/sphinx#1154
1 parent 8c01605 commit a8c03fe

File tree

7 files changed

+10
-71
lines changed

7 files changed

+10
-71
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
sudo apt-get install -y libfuse-dev
3636
3737
- name: Install Python dependencies (misc)
38-
run: pip install pytest "sphinx<7.0"
38+
run: pip install pytest sphinx
3939

4040
- name: Install Python dependencies (Cython 0.29)
4141
if: ${{ matrix.cython-version == '0.29' }}

developer-notes/release-process.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66

77
# Releasing a new version #
88
* `export DEVELOPER_MODE=0` # or just not have it set
9-
* Bump version in `setup.py`
9+
* Bump version in `setup.py` and version/release in `rst/conf.py`
1010
* Add release date to `Changes.rst`
1111
* Check `git status` to avoid undesired files in the tarball.
1212
* `./setup.py build_cython`
1313
* `./setup.py sdist`
1414
* Extract tarball in temporary directory,
1515
* `./setup.py build_ext --inplace && python3 -m pytest test`
1616
* Run tests under valgrind. Build python `--with-valgrind --with-pydebug`, then `valgrind --trace-children=yes "--trace-children-skip=*mount*" python-dbg -m pytest test/`
17-
* `./setup.py build_sphinx`
18-
* `./setup.py upload_docs`
17+
* `sphinx-build -b html rst doc/html`
1918
* `./util/sdist-sign 1.2.3` # use real version number, have GPG ready
2019
* `./util/upload-pypi 1.2.3` # use real version number, have twine installed
2120
* git commit, git tag -s

rst/conf.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@
5252

5353
# General information about the project.
5454
project = 'Python-LLFUSE'
55-
copyright = '2010-2015, Nikolaus Rath'
55+
copyright = '2010-2023, Nikolaus Rath'
5656

5757
# The version info for the project you're documenting, acts as replacement for
5858
# |version| and |release|, also used in various other places throughout the
5959
# built documents.
6060
#
6161
# The short X.Y version.
62-
version = '1.0'
62+
version = '1.4.4'
6363
# The full version, including alpha/beta/rc tags.
64-
release = '1.0'
64+
release = version + ''
6565

6666
# The language for content autogenerated by Sphinx. Refer to documentation
6767
# for a list of supported languages.
@@ -74,7 +74,7 @@
7474
#today_fmt = '%B %d, %Y'
7575

7676
# List of documents that shouldn't be included in the build.
77-
unused_docs = [ ]
77+
unused_docs = []
7878

7979
# List of directories, relative to source directory, that shouldn't be searched
8080
# for source files.

rst/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ necessary commands are::
6868
python setup.py build_cython
6969
python setup.py build_ext --inplace
7070
python -m pytest test/
71-
python setup.py build_sphinx
71+
sphinx-build -b html rst doc/html
7272
python setup.py install
7373

7474

setup.cfg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[build_sphinx]
2-
source-dir = rst
3-
build-dir = doc

setup.py

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,13 @@
4444
if DEVELOPER_MODE:
4545
print('running in developer mode')
4646
warnings.resetwarnings()
47-
# We can't use `error`, because e.g. Sphinx triggers a
48-
# DeprecationWarning.
4947
warnings.simplefilter('default')
5048

51-
# Add src to load path, important for Sphinx autodoc
52-
# to work properly
53-
sys.path.insert(0, os.path.join(basedir, 'src'))
5449

5550
LLFUSE_VERSION = '1.4.4'
5651

5752
def main():
5853

59-
try:
60-
from sphinx.application import Sphinx #pylint: disable-msg=W0612
61-
except ImportError:
62-
pass
63-
else:
64-
fix_docutils()
65-
6654
with open(os.path.join(basedir, 'README.rst')) as fh:
6755
long_desc = fh.read()
6856

@@ -143,13 +131,7 @@ def main():
143131
ext_modules=[Extension('llfuse', c_sources,
144132
extra_compile_args=compile_args,
145133
extra_link_args=link_args)],
146-
cmdclass={'upload_docs': upload_docs,
147-
'build_cython': build_cython },
148-
command_options={
149-
'build_sphinx': {
150-
'version': ('setup.py', LLFUSE_VERSION),
151-
'release': ('setup.py', LLFUSE_VERSION),
152-
}},
134+
cmdclass={'build_cython': build_cython},
153135
)
154136

155137

@@ -184,21 +166,6 @@ def pkg_config(pkg, cflags=True, ldflags=False, min_ver=None):
184166
return cflags.decode('us-ascii').split()
185167

186168

187-
class upload_docs(setuptools.Command):
188-
user_options = []
189-
boolean_options = []
190-
description = "Upload documentation"
191-
192-
def initialize_options(self):
193-
pass
194-
195-
def finalize_options(self):
196-
pass
197-
198-
def run(self):
199-
subprocess.check_call(['rsync', '-aHv', '--del', os.path.join(basedir, 'doc', 'html') + '/',
200-
'ebox.rath.org:/srv/www.rath.org/llfuse-docs/'])
201-
202169
class build_cython(setuptools.Command):
203170
user_options = []
204171
boolean_options = []
@@ -238,30 +205,6 @@ def run(self):
238205
if subprocess.call(cmd + [path + '.pyx']) != 0:
239206
raise SystemExit('Cython compilation failed')
240207

241-
def fix_docutils():
242-
'''Work around https://bitbucket.org/birkenfeld/sphinx/issue/1154/'''
243-
244-
import docutils.parsers
245-
from docutils.parsers import rst
246-
old_getclass = docutils.parsers.get_parser_class
247-
248-
# Check if bug is there
249-
try:
250-
old_getclass('rst')
251-
except AttributeError:
252-
pass
253-
else:
254-
return
255-
256-
def get_parser_class(parser_name):
257-
"""Return the Parser class from the `parser_name` module."""
258-
if parser_name in ('rst', 'restructuredtext'):
259-
return rst.Parser
260-
else:
261-
return old_getclass(parser_name)
262-
docutils.parsers.get_parser_class = get_parser_class
263-
264-
assert docutils.parsers.get_parser_class('rst') is rst.Parser
265208

266209
if __name__ == '__main__':
267210
main()

test/ci-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ python setup.py build_cython
66
python setup.py build_ext --inplace
77
python -m pytest test/
88

9-
python setup.py build_sphinx
9+
sphinx-build -b html rst doc/html

0 commit comments

Comments
 (0)