Skip to content

Commit

Permalink
Move pulpcore-plugin into pulpcore as a subpackage
Browse files Browse the repository at this point in the history
  • Loading branch information
dralley committed Oct 28, 2019
1 parent a4f57fd commit ed04368
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 42 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<!-- TEMPLATE_REMOVE_START -->

This is the ``plugin_template`` repository to help plugin writers get started and write their own
plugin for [Pulp Project 3.0+](https://pypi.python.org/pypi/pulpcore/).

Expand Down Expand Up @@ -423,19 +421,10 @@ optional arguments:
- [ ] Plugin django app is defined using PulpAppConfig as a parent
- [ ] Plugin entry point is defined
- [ ] pulpcore-plugin is specified as a requirement in setup.py
- [ ] Necessary models/serializers/viewsets are defined. At a minimum:
- [ ] models for plugin content type, remote, publisher
- [ ] serializers for plugin content type, remote, publisher
- [ ] viewset for plugin content type, remote, publisher
- [ ] Errors are handled according to Pulp conventions
- [ ] Docs for plugin are available (any location and format preferred and provided by plugin writer)
<!-- TEMPLATE_REMOVE_END -->
# {{ plugin_dash }}
A Pulp plugin to support hosting your own {{ plugin_dash_short }}.
For more information, please see the [documentation](docs/index.rst) or the [Pulp project page](https://pulpproject.org/).
5 changes: 1 addition & 4 deletions meta_docs/reference/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ Releasing Your Plugin
Packaging
---------

The Plugin API is available from PyPI as pulpcore-plugin. A plugin writer needs to specify the
minimum version of pulpcore-plugin their plugin is dependent on. A plugin writer does not need to
specify which version of pulpcore would work with their plugin since pulpcore-plugin will
resolve the pulpcore dependency.
A plugin writer needs to specify the minimum version of pulpcore their plugin is dependent on.
5 changes: 5 additions & 0 deletions templates/bootstrap/README.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# {{ plugin_dash }}

A Pulp plugin to support hosting your own {{ plugin_dash_short }}.

For more information, please see the [documentation](docs/index.rst) or the [Pulp project page](https://pulpproject.org/).
2 changes: 1 addition & 1 deletion templates/bootstrap/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import find_packages, setup

requirements = ["pulpcore-plugin>=0.1.0rc3"]
requirements = ["pulpcore>=3.0.0rc7"]

setup(
name="{{ plugin_dash }}",
Expand Down
17 changes: 5 additions & 12 deletions templates/travis/.travis.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@ python:
- "3.7"
env:
matrix:
- DB=postgres TEST=pulp
- TEST=pulp
{%- if docs_test %}
- DB=postgres TEST=docs
- TEST=docs
{%- endif %}
{%- if test_bindings %}
- DB=postgres TEST=bindings
- TEST=bindings
{%- endif %}
{%- if test_bindings or docs_test %}
matrix:
exclude:
{%- if test_bindings %}
- python: '3.6'
env: DB=postgres TEST=bindings
env: TEST=bindings
{%- endif %}
{%- if docs_test %}
- python: '3.6'
env: DB=postgres TEST=docs
env: TEST=docs
{%- endif %}
fast_finish: true
{%- endif %}
Expand Down Expand Up @@ -79,52 +79,45 @@ jobs:
- stage: publish-beta-docs
script: bash .travis/publish_docs.sh rc
env:
- DB=postgres
- TEST=docs
if: tag IS present
- stage: publish-continuous-docs
script: bash .travis/publish_docs.sh nightly
env:
- DB=postgres
- TEST=docs
if: type != pull_request
{%- endif %}
{%- if deploy_daily_client_to_rubygems %}
- stage: publish-daily-client-gem
script: bash .travis/publish_client_gem.sh
env:
- DB=postgres
- TEST=bindings
if: type = cron
{%- endif %}
{%- if deploy_daily_client_to_pypi %}
- stage: publish-daily-client-pypi
script: bash .travis/publish_client_pypi.sh
env:
- DB=postgres
- TEST=bindings
if: type = cron
{%- endif %}
{%- if deploy_client_to_rubygems %}
- stage: publish-client-gem
script: bash .travis/publish_client_gem.sh
env:
- DB=postgres
- TEST=bindings
if: tag IS present
{%- endif %}
{%- if deploy_client_to_pypi %}
- stage: publish-client-pypi
script: bash .travis/publish_client_pypi.sh
env:
- DB=postgres
- TEST=bindings
if: tag IS present
{%- endif %}
{%- if test_performance %}
- stage: daily-performance-test
env:
- DB=postgres
- TEST=performance
if: type = cron
{%- endif %}
Expand Down
15 changes: 2 additions & 13 deletions templates/travis/.travis/before_install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ fi
if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ -z "$TRAVIS_TAG" -a "$TRAVIS_BRANCH" != "master"]
then
export PULP_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_PLUGIN_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore-plugin\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_SMASH_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/PulpQE\/pulp-smash\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_ROLES_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/ansible-pulp\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_BINDINGS_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-openapi-generator\/pull\/(\d+)' | awk -F'/' '{print $7}')
export PULP_OPERATOR_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-operator\/pull\/(\d+)' | awk -F'/' '{print $7}')
else
export PULP_PR_NUMBER=
export PULP_PLUGIN_PR_NUMBER=
export PULP_SMASH_PR_NUMBER=
export PULP_ROLES_PR_NUMBER=
export PULP_BINDINGS_PR_NUMBER=
Expand Down Expand Up @@ -87,20 +85,11 @@ if [ -n "$PULP_PR_NUMBER" ]; then
fi
{% endif %}

{% if plugin_name != 'pulpcore' %}# When building a (release) tag, we don't need the development modules for the
{% if plugin_name != 'pulpcore' %}
# When building a (release) tag, we don't need the development modules for the
# build (they will be installed as dependencies of the plugin).
if [ -z "$TRAVIS_TAG" ]; then
{% endif %}
git clone --depth=1 https://github.com/pulp/pulpcore-plugin.git

if [ -n "$PULP_PLUGIN_PR_NUMBER" ]; then
cd pulpcore-plugin
git fetch --depth=1 origin +refs/pull/$PULP_PLUGIN_PR_NUMBER/merge
git checkout FETCH_HEAD
cd ..
fi


git clone --depth=1 https://github.com/PulpQE/pulp-smash.git

if [ -n "$PULP_SMASH_PR_NUMBER" ]; then
Expand Down
1 change: 0 additions & 1 deletion templates/travis/.travis/install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ images:
image_name: $PLUGIN
tag: $TAG
pulpcore: ./pulpcore
pulpcore_plugin: ./pulpcore-plugin
plugins:
- ./$PLUGIN
{%- for item in additional_plugins %}
Expand Down
3 changes: 3 additions & 0 deletions templates/travis/.travis/script.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export CMD_STDIN_PREFIX="sudo kubectl exec -i $PULP_API_POD --"
# The alias does not seem to work in Travis / the scripting framework
#alias pytest="$CMD_PREFIX pytest"

cat test_requirements.txt | $CMD_STDIN_PREFIX bash -c "cat > /tmp/test_requirements.txt"
$CMD_PREFIX pip3 install -r /tmp/test_requirements.txt

# Run unit tests.
$CMD_PREFIX bash -c "PULP_DATABASES__default__USER=postgres django-admin test --noinput /usr/local/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/{{ plugin_snake }}/tests/unit/"

Expand Down

0 comments on commit ed04368

Please sign in to comment.