Skip to content

Commit

Permalink
Problem: towncrier not integrated into plugin
Browse files Browse the repository at this point in the history
Solution: add towncrier

[noissue]
  • Loading branch information
dkliban committed Aug 6, 2019
1 parent 7f69c6f commit b8356f3
Show file tree
Hide file tree
Showing 15 changed files with 100 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .travis/publish_plugin_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
pip install twine

python setup.py sdist bdist_wheel --python-tag py3
twine upload dist/* -u None -p $PYPI_PASSWORD
twine upload dist/* -u pulp -p $PYPI_PASSWORD
14 changes: 14 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=========
Changelog
=========

..
You should *NOT* be adding new change log entries to this file, this
file is managed by towncrier. You *may* edit previous change logs to
fix problems like typo corrections or such.
To add a new change log entry, please see
https://docs.pulpproject.org/en/3.0/nightly/contributing/git.html#changelog-update
WARNING: Don't drop the next directive!

.. towncrier release notes start
37 changes: 37 additions & 0 deletions CHANGES/.TEMPLATE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

{# TOWNCRIER TEMPLATE #}
{% for section, _ in sections.items() %}
{% set underline = underlines[0] %}{% if section %}{{section}}
{{ underline * section|length }}{% set underline = underlines[1] %}

{% endif %}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section]%}
{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
- {{ text }}
{{ values|join(',\n ') }}
{% endfor %}

{% else %}
- {{ sections[section][category]['']|join(', ') }}

{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
{% endfor %}
----
1 change: 1 addition & 0 deletions CHANGES/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.gitignore
1 change: 1 addition & 0 deletions CHANGES/5217.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updates serializers and tests to make plugin compatible with pulpcore-plugin 0.1.0rc4.
Empty file added HISTORY.rst
Empty file.
2 changes: 2 additions & 0 deletions doc_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
towncrier
5 changes: 5 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. _pulp-maven-changes:

.. include:: ../CHANGES.rst

.. include:: ../HISTORY.rst
17 changes: 9 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

try:
import sphinx_rtd_theme
except ImportError:
sphinx_rtd_theme = False
import os
import sys
sys.path.insert(0, os.path.abspath('..')) # noqa

import pulp_maven

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -51,9 +52,9 @@
# built documents.
#
# The short X.Y version.
version = "2.0a1"
version = pulp_maven.__version__
# The full version, including alpha/beta/rc tags.
release = "2.0a1"
release = pulp_maven.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -94,7 +95,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme" if sphinx_rtd_theme else "default"
html_theme = "default"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -123,7 +124,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] if sphinx_rtd_theme else []
# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] if sphinx_rtd_theme else []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Table of Contents

installation
workflows/index
release-notes/3.0.z.rst
changes


Indices and tables
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ User Setup
All REST API examples below use `httpie <https://httpie.org/doc>`__ to
perform the requests.

.. code-block::
.. code-block:: bash
machine localhost
login admin
Expand Down
5 changes: 0 additions & 5 deletions docs/release-notes/0.0.z.rst

This file was deleted.

4 changes: 3 additions & 1 deletion pulp_maven/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__version__ = "0.1.0b3.dev"
import pkg_resources

__version__ = pkg_resources.get_distribution("pulp_maven").version

default_app_config = "pulp_maven.app.PulpMavenPluginAppConfig"
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[tool.towncrier]
package = "pulp_maven"
filename = "CHANGES.rst"
directory = "CHANGES/"
title_format = "{version} ({project_date})"
template = "CHANGES/.TEMPLATE.rst"
issue_format = "`#{issue} <https://pulp.plan.io/issues/{issue}>`_"

[tool.black]
line-length = 100
target-version = ["py36", "py37"]
exclude = '''
/(
\.eggs
| \.git
| \.venv
| _build
| build
| dist
| migrations
| docs
)/
'''

2 changes: 1 addition & 1 deletion template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ deploy_to_pypi: True
docs_test: True
pydocstyle: True
test_bindings: False
pypi_username: None
pypi_username: pulp
travis_notifications: None


0 comments on commit b8356f3

Please sign in to comment.