Skip to content

Commit

Permalink
Create new, simpler packaging tutorial (#498)
Browse files Browse the repository at this point in the history
Move the existing tutorial into guides/distributing-packages-using-setuptools to be cleaned up later.
  • Loading branch information
theacodes committed May 20, 2018
1 parent 48f829d commit 927eca1
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 8 deletions.
15 changes: 10 additions & 5 deletions nox.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,18 +8,23 @@




@nox.session @nox.session
def build(session): def build(session, autobuild=False):
session.interpreter = 'python3.6' session.interpreter = 'python3.6'
session.install('-r', 'requirements.txt') session.install('-r', 'requirements.txt')
# Treat warnings as errors. # Treat warnings as errors.
session.env['SPHINXOPTS'] = '-W' session.env['SPHINXOPTS'] = '-W'
session.run(shutil.rmtree, 'build', ignore_errors=True) session.run(shutil.rmtree, 'build', ignore_errors=True)
session.run('sphinx-build', '-W', '-b', 'html', 'source', 'build')
if autobuild:
command = 'sphinx-autobuild'
else:
command = 'sphinx-build'

session.run(command, '-W', '-b', 'html', 'source', 'build')




@nox.session @nox.session
def preview(session): def preview(session):
session.reuse_existing_virtualenv = True session.reuse_existing_virtualenv = True
build(session) session.install("sphinx-autobuild")
session.chdir('build') build(session, autobuild=True)
session.run('python', '-m', 'http.server')
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx==1.7.4 sphinx==1.7.4
sphinx-autobuild==0.7.1
git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme git+https://github.com/python/python-docs-theme.git#egg=python-docs-theme
git+https://github.com/pypa/pypa-docs-theme.git#egg=pypa-docs-theme git+https://github.com/pypa/pypa-docs-theme.git#egg=pypa-docs-theme
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Packaging and distributing projects


This section covers the basics of how to configure, package and distribute your This section covers the basics of how to configure, package and distribute your
own Python projects. It assumes that you are already familiar with the contents own Python projects. It assumes that you are already familiar with the contents
of the :doc:`installing-packages` page. of the :doc:`/tutorials/installing-packages` page.


The section does *not* aim to cover best practices for Python project The section does *not* aim to cover best practices for Python project
development as a whole. For example, it does not provide guidance or tool development as a whole. For example, it does not provide guidance or tool
Expand Down
1 change: 1 addition & 0 deletions source/guides/index.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ introduction to packaging, see :doc:`/tutorials/index`.
installing-using-linux-tools installing-using-linux-tools
installing-scientific-packages installing-scientific-packages
multi-version-installs multi-version-installs
distributing-packages-using-setuptools
single-sourcing-package-version single-sourcing-package-version
supporting-multiple-python-versions supporting-multiple-python-versions
dropping-older-python-versions dropping-older-python-versions
Expand Down
2 changes: 1 addition & 1 deletion source/index.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ covered in our :doc:`tutorials/index` section:
* to learn how to manage dependencies in a version controlled project, see the * to learn how to manage dependencies in a version controlled project, see the
:doc:`tutorial on managing application dependencies <tutorials/managing-dependencies>`. :doc:`tutorial on managing application dependencies <tutorials/managing-dependencies>`.
* to learn how to package and distribute your projects, see the * to learn how to package and distribute your projects, see the
:doc:`tutorial on packaging and distributing <tutorials/distributing-packages>` :doc:`tutorial on packaging and distributing <tutorials/packaging-projects>`


Learn more Learn more
========== ==========
Expand Down
2 changes: 2 additions & 0 deletions source/key_projects.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ a complimentary command line tool to drive packaging, testing and release
activities with Python. activities with Python.




.. _flit:

flit flit
==== ====


Expand Down
2 changes: 1 addition & 1 deletion source/tutorials/index.rst
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ topics, see :doc:`/guides/index`.


installing-packages installing-packages
managing-dependencies managing-dependencies
distributing-packages packaging-projects
Loading

0 comments on commit 927eca1

Please sign in to comment.