Skip to content

Commit

Permalink
Fix Python packaging which previously included the "tests" package
Browse files Browse the repository at this point in the history
After reading thought https://packaging.python.org and
https://docs.python.org/3/distutils/ again, I decided to continue using
the `find_packages` helper function because this make copy and paste
easier when I decide to reuse this little project as a template for the
next Python project. But ensure that Python packages like tests and docs
are not installed by excluding them.
It is directly used from the example given here: https://packaging.python.org/distributing/#packages

Also add `package_data` to ensure that the Jinja2 templates of the
package are included.

Now only the "yaml4rst" package is installed which can be quickly
verified by `pip3 uninstall yaml4rst`:

```
Uninstalling yaml4rst:
  /usr/local/lib/python3.5/dist-packages/yaml4rst-0.1.1.dist-info/DESCRIPTION.rst
  /usr/local/lib/python3.5/dist-packages/yaml4rst-0.1.1.dist-info/METADATA
  /usr/local/lib/python3.5/dist-packages/yaml4rst-0.1.1.dist-info/RECORD
  /usr/local/lib/python3.5/dist-packages/yaml4rst-0.1.1.dist-info/WHEEL
  /usr/local/lib/python3.5/dist-packages/yaml4rst-0.1.1.dist-info/entry_points.txt
  /usr/local/lib/python3.5/dist-packages/yaml4rst-0.1.1.dist-info/metadata.json
  /usr/local/lib/python3.5/dist-packages/yaml4rst-0.1.1.dist-info/top_level.txt
  /usr/local/lib/python3.5/dist-packages/yaml4rst/__init__.py
  /usr/local/lib/python3.5/dist-packages/yaml4rst/__pycache__/__init__.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/yaml4rst/__pycache__/_meta.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/yaml4rst/__pycache__/cli.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/yaml4rst/__pycache__/defaults.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/yaml4rst/__pycache__/helpers.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/yaml4rst/__pycache__/reformatter.cpython-35.pyc
  /usr/local/lib/python3.5/dist-packages/yaml4rst/_meta.py
  /usr/local/lib/python3.5/dist-packages/yaml4rst/cli.py
  /usr/local/lib/python3.5/dist-packages/yaml4rst/defaults.py
  /usr/local/lib/python3.5/dist-packages/yaml4rst/helpers.py
  /usr/local/lib/python3.5/dist-packages/yaml4rst/reformatter.py
```

Related to: #1
Thanks to: @ganto
  • Loading branch information
ypid committed Nov 17, 2016
1 parent c0d8cb9 commit d769cf1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ yaml4rst master - unreleased

.. _yaml4rst master: https://github.com/ypid/yaml4rst/compare/v0.1.1...master

Fixed
~~~~~

- Python packaging which previously included and installed the unit tests as
separate "tests" Python package.
Now the built distribution release (Wheel) only contains the actual Python package
"yaml4rst" without the unit tests. Checkout the source distribution or the
git repository for hacking on the project.
Thanks very much to ganto_ for reporting and providing a patch! [ypid_]


`yaml4rst v0.1.1`_ - 2016-11-05
-------------------------------
Expand Down
38 changes: 38 additions & 0 deletions docs/includes/global.rst
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,44 @@
.. _debops.directories: https://github.com/debops/ansible-directories
.. ]]]
.. DebOps People [[[
.. Link target preference:
1. DebOps People
2. DebOps Wiki
3. GitHub profile
4. Any HTTPS URL
5. Any legacy HTTP URL
.. _DebOps People: https://docs.debops.org/en/latest/debops-keyring/docs/entities.html

.. _drybjed: https://docs.debops.org/en/latest/debops-keyring/docs/entities.html#debops-keyring-entity-drybjed
.. _ypid-ansible-common: https://github.com/ypid/ypid-ansible-common/
.. _ypid-ansible-inventory: https://github.com/ypid/ypid-ansible-inventory

.. _le9i0nx: https://docs.debops.org/en/latest/debops-keyring/docs/entities.html#debops-keyring-entity-le9i0nx

.. _AnBuKu: https://github.com/AnBuKu
.. AuBuKa aka. hugi
.. _ganto: https://github.com/ganto
.. _htgoebel: https://github.com/htgoebel
.. _nickjj: https://github.com/nickjj
.. _scibi: https://github.com/scibi
.. _do3cc: https://github.com/do3cc
.. _thiagotalma: https://github.com/thiagotalma
.. _mbarcia: https://github.com/mbarcia
.. _jacksingleton: https://github.com/jacksingleton
.. _ser: https://github.com/ser
.. _yuvadm: https://github.com/yuvadm
.. _pedroluislopez: https://github.com/pedroluislopez
.. _patrickheeney: https://github.com/patrickheeney
.. _rchady: https://github.com/rchady
.. _tallandtree: https://github.com/tallandtree
.. _zpfvo: https://github.com/zpfvo

.. ]]]
.. External [[[
.. Link target preference:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
'Topic :: Text Processing',
),
keywords='YML YAML RST reStructuresText Ansible DebOps linting docs documentation',
packages=find_packages(),
packages=find_packages(exclude=['contrib', 'docs', 'tests*']),
package_data={'yaml4rst': ['*.j2']},
install_requires=[
# Debian packages: python-yaml python3-yaml python-jinja2 python3-jinja2
'PyYAML',
Expand Down

0 comments on commit d769cf1

Please sign in to comment.