Skip to content
Snippets Groups Projects
Commit ea77cae9 authored by Apertis package maintainers's avatar Apertis package maintainers
Browse files

Import Upstream version 0.2.3

parents
Branches upstream/trixie
Tags upstream/0.2.3
No related merge requests found
name: Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Checkout the repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: python -m pip install -r tests/requirements.txt
- name: Run tests
run: make test
*.pyc
*.pyo
__pycache__/
*.eggs/
*.egg-info/
dist/
LICENSE 0 → 100644
Copyright (c) 2016, Alexander Todorov <atodorov@MrSenko.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of sphinx-removed-in nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Makefile 0 → 100644
test:
flake8 setup.py sphinx_removed_in tests
python -m pytest -v
build: test
./setup.py sdist
upload: test
./setup.py sdist upload
clean:
./setup.py clean
rm -rf *.egg-info/
rm -f *.pyc sphinx_removed_in/*.pyc
distclean: clean
rm -rf dist/
help:
@echo "Usage: make <target> "
@echo " "
@echo " test - run the tests "
@echo " build - build the package "
@echo " upload - upload to PyPI "
@echo " clean - remove all build files "
@echo " distclean - remove all non git files "
@echo " help - show this help and exit "
Sphinx Removed In Extension
---------------------------
.. image:: https://travis-ci.org/MrSenko/sphinx-removed-in.svg?branch=master
:target: https://travis-ci.org/MrSenko/sphinx-removed-in
.. image:: https://coveralls.io/repos/github/MrSenko/sphinx-removed-in/badge.svg?branch=master
:target: https://coveralls.io/github/MrSenko/sphinx-removed-in?branch=master
.. image:: https://landscape.io/github/MrSenko/sphinx-removed-in/master/landscape.svg?style=flat
:target: https://landscape.io/github/MrSenko/sphinx-removed-in/master
:alt: Code Health
This is a Sphinx extension which recognizes the ``.. versionremoved::`` and
``.. removed-in::`` directives. These are missing from Sphinx'es
`core markup <http://www.sphinx-doc.org/en/stable/markup/para.html>`_.
Installation
============
Use pip to install from PyPI:
::
pip install sphinx-removed-in
Configure your ``conf.py``:
::
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx_removed_in']
Contributing
============
Source code and issue tracker are at https://github.com/MrSenko/sphinx-removed-in
master_doc = 'index'
extensions = ['sphinx_removed_in']
This is the documentation for sphinx-removed-in.
.. versionremoved:: 1.2
.. removed-in:: 3.2
setup.py 0 → 100755
#!/usr/bin/env python
from setuptools import setup, find_packages
__version__ = __import__('sphinx_removed_in').__version__
with open('README.rst') as file:
long_description = file.read()
config = {
'name': 'sphinx-removed-in',
'version': __version__,
'packages': find_packages(exclude=['tests']),
'author': 'Alexander Todorov',
'author_email': 'atodorov@MrSenko.com',
'license': 'BSD',
'description': 'versionremoved and removed-in directives for Sphinx',
'long_description': long_description,
'url': 'https://github.com/MrSenko/sphinx-removed-in',
'keywords': ['Sphinx'],
'classifiers': [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: Web Environment',
'Framework :: Sphinx',
'Framework :: Sphinx :: Extension',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Documentation',
'Topic :: Documentation :: Sphinx',
'Topic :: Text Processing',
'Topic :: Utilities',
],
'zip_safe': False,
'install_requires': ['Sphinx'],
}
setup(**config)
__version__ = '0.2.3'
def setup(app):
try:
from sphinx.domains.changeset import versionlabels
except ImportError:
from sphinx.locale import versionlabels
from sphinx.domains.changeset import VersionChange
try:
from sphinx.domains.changeset import versionlabel_classes
except ImportError:
versionlabel_classes = {} # dummy dict for Sphinx < 2
for _directive in ['versionremoved', 'removed-in']:
if _directive not in versionlabels:
versionlabels[_directive] = 'Removed in version %s'
versionlabel_classes[_directive] = 'removed'
app.add_directive(_directive, VersionChange)
return {
'version': __version__,
'parallel_read_safe': True,
'parallel_write_safe': True,
}
pytest_plugins = 'sphinx.testing.fixtures'
Sphinx
flake8
coverage
pytest
import os
import sys
import pytest
PARENT = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')
sys.path.insert(0, PARENT)
@pytest.mark.sphinx(buildername='html', srcdir=os.path.join(PARENT, 'docs'))
def test_sphinx_build(app, status, warning):
app.build()
try:
html = (app.outdir / 'index.html').read_text()
except AttributeError:
# an older version of sphinx (used e.g. on Python 2)
# use the now deprecated API instead
html = (app.outdir / 'index.html').text()
assert 'Removed in version 1.2' in html
assert 'Removed in version 3.2' in html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment