From ccf288380adb995c88a3dabe77c94c24405e6f0b Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 10:45:34 -0500 Subject: chore: sync w/ cookiecutter Fix applied in this commit: https://github.com/Pylons/pyramid-cookiecutter-starter/commit/8b139f68b7a2a8036d59fcf1bf9df4f46e06349e --- docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt | 4 ++-- docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt | 4 ++-- docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt | 4 ++-- docs/tutorials/wiki/src/models/tutorial/templates/layout.pt | 4 ++-- docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt | 4 ++-- docs/tutorials/wiki/src/views/tutorial/templates/layout.pt | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt index 369b2be1a..58ae63ea3 100644 --- a/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/authorization/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - - + + diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt index 2e65a93c4..e6b52e78a 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - - + + diff --git a/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt index 2e65a93c4..e6b52e78a 100644 --- a/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/installation/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - - + + diff --git a/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt index 2e65a93c4..e6b52e78a 100644 --- a/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/models/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - - + + diff --git a/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt index 369b2be1a..58ae63ea3 100644 --- a/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/tests/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - - + + diff --git a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt index 62d5f28aa..845ca151a 100644 --- a/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt +++ b/docs/tutorials/wiki/src/views/tutorial/templates/layout.pt @@ -1,5 +1,5 @@ - - + + -- cgit v1.2.3 From 5229e501acd802e90220c754e4c09de582967bbd Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 10:55:15 -0500 Subject: chore: sync w/ generation from project name 'tutorial' --- docs/tutorials/wiki/src/authorization/tests/test_views.py | 2 +- docs/tutorials/wiki/src/basiclayout/tests/test_views.py | 2 +- docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py | 2 +- docs/tutorials/wiki/src/installation/tests/test_views.py | 2 +- docs/tutorials/wiki/src/installation/tutorial/views/default.py | 2 +- docs/tutorials/wiki/src/models/tests/test_views.py | 2 +- docs/tutorials/wiki/src/models/tutorial/views/default.py | 2 +- docs/tutorials/wiki/src/views/tests/test_views.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/tutorials/wiki/src/authorization/tests/test_views.py b/docs/tutorials/wiki/src/authorization/tests/test_views.py index 2b4201955..c2e28dd63 100644 --- a/docs/tutorials/wiki/src/authorization/tests/test_views.py +++ b/docs/tutorials/wiki/src/authorization/tests/test_views.py @@ -5,7 +5,7 @@ from tutorial.views.notfound import notfound_view def test_my_view(app_request): info = my_view(app_request) assert app_request.response.status_int == 200 - assert info['project'] == 'myproj' + assert info['project'] == 'tutorial' def test_notfound_view(app_request): info = notfound_view(app_request) diff --git a/docs/tutorials/wiki/src/basiclayout/tests/test_views.py b/docs/tutorials/wiki/src/basiclayout/tests/test_views.py index 2b4201955..c2e28dd63 100644 --- a/docs/tutorials/wiki/src/basiclayout/tests/test_views.py +++ b/docs/tutorials/wiki/src/basiclayout/tests/test_views.py @@ -5,7 +5,7 @@ from tutorial.views.notfound import notfound_view def test_my_view(app_request): info = my_view(app_request) assert app_request.response.status_int == 200 - assert info['project'] == 'myproj' + assert info['project'] == 'tutorial' def test_notfound_view(app_request): info = notfound_view(app_request) diff --git a/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py b/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py index 51ec5ed98..c849e82d9 100644 --- a/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/basiclayout/tutorial/views/default.py @@ -5,4 +5,4 @@ from ..models import MyModel @view_config(context=MyModel, renderer='tutorial:templates/mytemplate.pt') def my_view(request): - return {'project': 'myproj'} + return {'project': 'tutorial'} diff --git a/docs/tutorials/wiki/src/installation/tests/test_views.py b/docs/tutorials/wiki/src/installation/tests/test_views.py index 2b4201955..c2e28dd63 100644 --- a/docs/tutorials/wiki/src/installation/tests/test_views.py +++ b/docs/tutorials/wiki/src/installation/tests/test_views.py @@ -5,7 +5,7 @@ from tutorial.views.notfound import notfound_view def test_my_view(app_request): info = my_view(app_request) assert app_request.response.status_int == 200 - assert info['project'] == 'myproj' + assert info['project'] == 'tutorial' def test_notfound_view(app_request): info = notfound_view(app_request) diff --git a/docs/tutorials/wiki/src/installation/tutorial/views/default.py b/docs/tutorials/wiki/src/installation/tutorial/views/default.py index 51ec5ed98..c849e82d9 100644 --- a/docs/tutorials/wiki/src/installation/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/installation/tutorial/views/default.py @@ -5,4 +5,4 @@ from ..models import MyModel @view_config(context=MyModel, renderer='tutorial:templates/mytemplate.pt') def my_view(request): - return {'project': 'myproj'} + return {'project': 'tutorial'} diff --git a/docs/tutorials/wiki/src/models/tests/test_views.py b/docs/tutorials/wiki/src/models/tests/test_views.py index 2b4201955..c2e28dd63 100644 --- a/docs/tutorials/wiki/src/models/tests/test_views.py +++ b/docs/tutorials/wiki/src/models/tests/test_views.py @@ -5,7 +5,7 @@ from tutorial.views.notfound import notfound_view def test_my_view(app_request): info = my_view(app_request) assert app_request.response.status_int == 200 - assert info['project'] == 'myproj' + assert info['project'] == 'tutorial' def test_notfound_view(app_request): info = notfound_view(app_request) diff --git a/docs/tutorials/wiki/src/models/tutorial/views/default.py b/docs/tutorials/wiki/src/models/tutorial/views/default.py index 51ec5ed98..c849e82d9 100644 --- a/docs/tutorials/wiki/src/models/tutorial/views/default.py +++ b/docs/tutorials/wiki/src/models/tutorial/views/default.py @@ -5,4 +5,4 @@ from ..models import MyModel @view_config(context=MyModel, renderer='tutorial:templates/mytemplate.pt') def my_view(request): - return {'project': 'myproj'} + return {'project': 'tutorial'} diff --git a/docs/tutorials/wiki/src/views/tests/test_views.py b/docs/tutorials/wiki/src/views/tests/test_views.py index 2b4201955..c2e28dd63 100644 --- a/docs/tutorials/wiki/src/views/tests/test_views.py +++ b/docs/tutorials/wiki/src/views/tests/test_views.py @@ -5,7 +5,7 @@ from tutorial.views.notfound import notfound_view def test_my_view(app_request): info = my_view(app_request) assert app_request.response.status_int == 200 - assert info['project'] == 'myproj' + assert info['project'] == 'tutorial' def test_notfound_view(app_request): info = notfound_view(app_request) -- cgit v1.2.3 From 948577c10e7fe0f645d9699d1cd0bbca351cc9bd Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 11:06:48 -0500 Subject: chore: sync with cookiecutter: - Use 'pyproject.toml' rather than 'setup.py', 'pytest.ini', '.coveragerg'. - Drop 'CHANGES.txt': implementing that in 'pyproject.toml' is a distraction. - Convert README to Markdown. --- docs/tutorials/wiki/src/authorization/.coveragerc | 2 - docs/tutorials/wiki/src/authorization/CHANGES.txt | 4 -- docs/tutorials/wiki/src/authorization/MANIFEST.in | 2 +- docs/tutorials/wiki/src/authorization/README.md | 40 +++++++++++++++ docs/tutorials/wiki/src/authorization/README.txt | 30 ----------- .../wiki/src/authorization/pyproject.toml | 56 ++++++++++++++++++++ docs/tutorials/wiki/src/authorization/pytest.ini | 6 --- docs/tutorials/wiki/src/authorization/setup.py | 59 ---------------------- docs/tutorials/wiki/src/basiclayout/.coveragerc | 2 - docs/tutorials/wiki/src/basiclayout/CHANGES.txt | 4 -- docs/tutorials/wiki/src/basiclayout/MANIFEST.in | 2 +- docs/tutorials/wiki/src/basiclayout/README.md | 40 +++++++++++++++ docs/tutorials/wiki/src/basiclayout/README.txt | 30 ----------- docs/tutorials/wiki/src/basiclayout/pyproject.toml | 56 ++++++++++++++++++++ docs/tutorials/wiki/src/basiclayout/pytest.ini | 6 --- docs/tutorials/wiki/src/basiclayout/setup.py | 57 --------------------- docs/tutorials/wiki/src/installation/.coveragerc | 2 - docs/tutorials/wiki/src/installation/CHANGES.txt | 4 -- docs/tutorials/wiki/src/installation/MANIFEST.in | 2 +- docs/tutorials/wiki/src/installation/README.md | 40 +++++++++++++++ docs/tutorials/wiki/src/installation/README.txt | 30 ----------- .../tutorials/wiki/src/installation/pyproject.toml | 56 ++++++++++++++++++++ docs/tutorials/wiki/src/installation/pytest.ini | 6 --- docs/tutorials/wiki/src/installation/setup.py | 57 --------------------- docs/tutorials/wiki/src/models/.coveragerc | 2 - docs/tutorials/wiki/src/models/CHANGES.txt | 4 -- docs/tutorials/wiki/src/models/MANIFEST.in | 2 +- docs/tutorials/wiki/src/models/README.md | 40 +++++++++++++++ docs/tutorials/wiki/src/models/README.txt | 30 ----------- docs/tutorials/wiki/src/models/pyproject.toml | 56 ++++++++++++++++++++ docs/tutorials/wiki/src/models/pytest.ini | 6 --- docs/tutorials/wiki/src/models/setup.py | 57 --------------------- docs/tutorials/wiki/src/tests/.coveragerc | 2 - docs/tutorials/wiki/src/tests/CHANGES.txt | 4 -- docs/tutorials/wiki/src/tests/MANIFEST.in | 2 +- docs/tutorials/wiki/src/tests/README.md | 40 +++++++++++++++ docs/tutorials/wiki/src/tests/README.txt | 30 ----------- docs/tutorials/wiki/src/tests/pyproject.toml | 56 ++++++++++++++++++++ docs/tutorials/wiki/src/tests/pytest.ini | 6 --- docs/tutorials/wiki/src/tests/setup.py | 59 ---------------------- docs/tutorials/wiki/src/views/.coveragerc | 2 - docs/tutorials/wiki/src/views/CHANGES.txt | 4 -- docs/tutorials/wiki/src/views/MANIFEST.in | 2 +- docs/tutorials/wiki/src/views/README.md | 40 +++++++++++++++ docs/tutorials/wiki/src/views/README.txt | 30 ----------- docs/tutorials/wiki/src/views/pyproject.toml | 56 ++++++++++++++++++++ docs/tutorials/wiki/src/views/pytest.ini | 6 --- docs/tutorials/wiki/src/views/setup.py | 58 --------------------- 48 files changed, 582 insertions(+), 605 deletions(-) delete mode 100644 docs/tutorials/wiki/src/authorization/.coveragerc delete mode 100644 docs/tutorials/wiki/src/authorization/CHANGES.txt create mode 100644 docs/tutorials/wiki/src/authorization/README.md delete mode 100644 docs/tutorials/wiki/src/authorization/README.txt create mode 100644 docs/tutorials/wiki/src/authorization/pyproject.toml delete mode 100644 docs/tutorials/wiki/src/authorization/pytest.ini delete mode 100644 docs/tutorials/wiki/src/authorization/setup.py delete mode 100644 docs/tutorials/wiki/src/basiclayout/.coveragerc delete mode 100644 docs/tutorials/wiki/src/basiclayout/CHANGES.txt create mode 100644 docs/tutorials/wiki/src/basiclayout/README.md delete mode 100644 docs/tutorials/wiki/src/basiclayout/README.txt create mode 100644 docs/tutorials/wiki/src/basiclayout/pyproject.toml delete mode 100644 docs/tutorials/wiki/src/basiclayout/pytest.ini delete mode 100644 docs/tutorials/wiki/src/basiclayout/setup.py delete mode 100644 docs/tutorials/wiki/src/installation/.coveragerc delete mode 100644 docs/tutorials/wiki/src/installation/CHANGES.txt create mode 100644 docs/tutorials/wiki/src/installation/README.md delete mode 100644 docs/tutorials/wiki/src/installation/README.txt create mode 100644 docs/tutorials/wiki/src/installation/pyproject.toml delete mode 100644 docs/tutorials/wiki/src/installation/pytest.ini delete mode 100644 docs/tutorials/wiki/src/installation/setup.py delete mode 100644 docs/tutorials/wiki/src/models/.coveragerc delete mode 100644 docs/tutorials/wiki/src/models/CHANGES.txt create mode 100644 docs/tutorials/wiki/src/models/README.md delete mode 100644 docs/tutorials/wiki/src/models/README.txt create mode 100644 docs/tutorials/wiki/src/models/pyproject.toml delete mode 100644 docs/tutorials/wiki/src/models/pytest.ini delete mode 100644 docs/tutorials/wiki/src/models/setup.py delete mode 100644 docs/tutorials/wiki/src/tests/.coveragerc delete mode 100644 docs/tutorials/wiki/src/tests/CHANGES.txt create mode 100644 docs/tutorials/wiki/src/tests/README.md delete mode 100644 docs/tutorials/wiki/src/tests/README.txt create mode 100644 docs/tutorials/wiki/src/tests/pyproject.toml delete mode 100644 docs/tutorials/wiki/src/tests/pytest.ini delete mode 100644 docs/tutorials/wiki/src/tests/setup.py delete mode 100644 docs/tutorials/wiki/src/views/.coveragerc delete mode 100644 docs/tutorials/wiki/src/views/CHANGES.txt create mode 100644 docs/tutorials/wiki/src/views/README.md delete mode 100644 docs/tutorials/wiki/src/views/README.txt create mode 100644 docs/tutorials/wiki/src/views/pyproject.toml delete mode 100644 docs/tutorials/wiki/src/views/pytest.ini delete mode 100644 docs/tutorials/wiki/src/views/setup.py diff --git a/docs/tutorials/wiki/src/authorization/.coveragerc b/docs/tutorials/wiki/src/authorization/.coveragerc deleted file mode 100644 index 5db0e79cf..000000000 --- a/docs/tutorials/wiki/src/authorization/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = tutorial diff --git a/docs/tutorials/wiki/src/authorization/CHANGES.txt b/docs/tutorials/wiki/src/authorization/CHANGES.txt deleted file mode 100644 index 14b902fd1..000000000 --- a/docs/tutorials/wiki/src/authorization/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version. diff --git a/docs/tutorials/wiki/src/authorization/MANIFEST.in b/docs/tutorials/wiki/src/authorization/MANIFEST.in index b4624fd1c..131373dc0 100644 --- a/docs/tutorials/wiki/src/authorization/MANIFEST.in +++ b/docs/tutorials/wiki/src/authorization/MANIFEST.in @@ -1,4 +1,4 @@ -include *.txt *.ini *.cfg *.rst +include *.txt *.ini *.cfg *.md *.toml recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 recursive-include tests * recursive-exclude * __pycache__ diff --git a/docs/tutorials/wiki/src/authorization/README.md b/docs/tutorials/wiki/src/authorization/README.md new file mode 100644 index 000000000..d0126f5aa --- /dev/null +++ b/docs/tutorials/wiki/src/authorization/README.md @@ -0,0 +1,40 @@ +# tutorial + +## Getting Started + +- Change directory into your newly created project if not already there. Your + current directory should be the same as this `README.md` file and `pyproject.toml`. + + ``` + cd tutorial + ``` + +- Create a Python virtual environment, if not already created. + + ``` + python3 -m venv env + ``` + +- Upgrade packaging tools, if necessary. + + ``` + env/bin/pip install --upgrade pip + ``` + +- Install the project in editable mode with its testing requirements. + + ``` + env/bin/pip install -e ".[testing]" + ``` + +- Run your project's tests. + + ``` + env/bin/pytest + ``` + +- Run your project. + + ``` + env/bin/pserve development.ini + ``` diff --git a/docs/tutorials/wiki/src/authorization/README.txt b/docs/tutorials/wiki/src/authorization/README.txt deleted file mode 100644 index b4a924cc4..000000000 --- a/docs/tutorials/wiki/src/authorization/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -myproj -====== - -Getting Started ---------------- - -- Change directory into your newly created project if not already there. Your - current directory should be the same as this README.txt file and setup.py. - - cd tutorial - -- Create a Python virtual environment, if not already created. - - python3 -m venv env - -- Upgrade packaging tools, if necessary. - - env/bin/pip install --upgrade pip setuptools - -- Install the project in editable mode with its testing requirements. - - env/bin/pip install -e ".[testing]" - -- Run your project's tests. - - env/bin/pytest - -- Run your project. - - env/bin/pserve development.ini diff --git a/docs/tutorials/wiki/src/authorization/pyproject.toml b/docs/tutorials/wiki/src/authorization/pyproject.toml new file mode 100644 index 000000000..ba317b67b --- /dev/null +++ b/docs/tutorials/wiki/src/authorization/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +version = "0.0" +name = "tutorial" +authors = [] +description = "tutorial" +readme = "README.md" +keywords = ["web", "pyramid", "pylons"] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", +] +requires-python = ">=3.8" +dependencies = [ + "plaster_pastedeploy", + "pyramid", + "pyramid_chameleon", + "pyramid_debugtoolbar", + "waitress", + "pyramid_retry", + "pyramid_tm", + "pyramid_zodbconn", + "transaction", + "ZODB", +] + +[project.optional-dependencies] +testing = [ + "WebTest", + "pytest", + "pytest-cov", +] + +[project.entry-points."paste.app_factory"] +main = "tutorial:main" + +[tool.setuptools.packages.find] +exclude = ["tests"] + +[tool.coverage.run] +source = [ + "tutorial", +] + +[tool.pytest.ini_options] +addopts = "--strict-markers" +testpaths = [ + "tutorial", + "tests", +] diff --git a/docs/tutorials/wiki/src/authorization/pytest.ini b/docs/tutorials/wiki/src/authorization/pytest.ini deleted file mode 100644 index 3df78fe9d..000000000 --- a/docs/tutorials/wiki/src/authorization/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pytest] -addopts = --strict-markers - -testpaths = - tutorial - tests diff --git a/docs/tutorials/wiki/src/authorization/setup.py b/docs/tutorials/wiki/src/authorization/setup.py deleted file mode 100644 index f619a9915..000000000 --- a/docs/tutorials/wiki/src/authorization/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'bcrypt', - 'docutils', - 'plaster_pastedeploy', - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - 'pyramid_retry', - 'pyramid_tm', - 'pyramid_zodbconn', - 'transaction', - 'ZODB', -] - -tests_require = [ - 'WebTest', - 'pytest', - 'pytest-cov', -] - -setup( - name='tutorial', - version='0.0', - description='myproj', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Pyramid', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(exclude=['tests']), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points={ - 'paste.app_factory': [ - 'main = tutorial:main', - ], - }, -) diff --git a/docs/tutorials/wiki/src/basiclayout/.coveragerc b/docs/tutorials/wiki/src/basiclayout/.coveragerc deleted file mode 100644 index 5db0e79cf..000000000 --- a/docs/tutorials/wiki/src/basiclayout/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = tutorial diff --git a/docs/tutorials/wiki/src/basiclayout/CHANGES.txt b/docs/tutorials/wiki/src/basiclayout/CHANGES.txt deleted file mode 100644 index 14b902fd1..000000000 --- a/docs/tutorials/wiki/src/basiclayout/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version. diff --git a/docs/tutorials/wiki/src/basiclayout/MANIFEST.in b/docs/tutorials/wiki/src/basiclayout/MANIFEST.in index b4624fd1c..131373dc0 100644 --- a/docs/tutorials/wiki/src/basiclayout/MANIFEST.in +++ b/docs/tutorials/wiki/src/basiclayout/MANIFEST.in @@ -1,4 +1,4 @@ -include *.txt *.ini *.cfg *.rst +include *.txt *.ini *.cfg *.md *.toml recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 recursive-include tests * recursive-exclude * __pycache__ diff --git a/docs/tutorials/wiki/src/basiclayout/README.md b/docs/tutorials/wiki/src/basiclayout/README.md new file mode 100644 index 000000000..d0126f5aa --- /dev/null +++ b/docs/tutorials/wiki/src/basiclayout/README.md @@ -0,0 +1,40 @@ +# tutorial + +## Getting Started + +- Change directory into your newly created project if not already there. Your + current directory should be the same as this `README.md` file and `pyproject.toml`. + + ``` + cd tutorial + ``` + +- Create a Python virtual environment, if not already created. + + ``` + python3 -m venv env + ``` + +- Upgrade packaging tools, if necessary. + + ``` + env/bin/pip install --upgrade pip + ``` + +- Install the project in editable mode with its testing requirements. + + ``` + env/bin/pip install -e ".[testing]" + ``` + +- Run your project's tests. + + ``` + env/bin/pytest + ``` + +- Run your project. + + ``` + env/bin/pserve development.ini + ``` diff --git a/docs/tutorials/wiki/src/basiclayout/README.txt b/docs/tutorials/wiki/src/basiclayout/README.txt deleted file mode 100644 index b4a924cc4..000000000 --- a/docs/tutorials/wiki/src/basiclayout/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -myproj -====== - -Getting Started ---------------- - -- Change directory into your newly created project if not already there. Your - current directory should be the same as this README.txt file and setup.py. - - cd tutorial - -- Create a Python virtual environment, if not already created. - - python3 -m venv env - -- Upgrade packaging tools, if necessary. - - env/bin/pip install --upgrade pip setuptools - -- Install the project in editable mode with its testing requirements. - - env/bin/pip install -e ".[testing]" - -- Run your project's tests. - - env/bin/pytest - -- Run your project. - - env/bin/pserve development.ini diff --git a/docs/tutorials/wiki/src/basiclayout/pyproject.toml b/docs/tutorials/wiki/src/basiclayout/pyproject.toml new file mode 100644 index 000000000..ba317b67b --- /dev/null +++ b/docs/tutorials/wiki/src/basiclayout/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +version = "0.0" +name = "tutorial" +authors = [] +description = "tutorial" +readme = "README.md" +keywords = ["web", "pyramid", "pylons"] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", +] +requires-python = ">=3.8" +dependencies = [ + "plaster_pastedeploy", + "pyramid", + "pyramid_chameleon", + "pyramid_debugtoolbar", + "waitress", + "pyramid_retry", + "pyramid_tm", + "pyramid_zodbconn", + "transaction", + "ZODB", +] + +[project.optional-dependencies] +testing = [ + "WebTest", + "pytest", + "pytest-cov", +] + +[project.entry-points."paste.app_factory"] +main = "tutorial:main" + +[tool.setuptools.packages.find] +exclude = ["tests"] + +[tool.coverage.run] +source = [ + "tutorial", +] + +[tool.pytest.ini_options] +addopts = "--strict-markers" +testpaths = [ + "tutorial", + "tests", +] diff --git a/docs/tutorials/wiki/src/basiclayout/pytest.ini b/docs/tutorials/wiki/src/basiclayout/pytest.ini deleted file mode 100644 index 3df78fe9d..000000000 --- a/docs/tutorials/wiki/src/basiclayout/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pytest] -addopts = --strict-markers - -testpaths = - tutorial - tests diff --git a/docs/tutorials/wiki/src/basiclayout/setup.py b/docs/tutorials/wiki/src/basiclayout/setup.py deleted file mode 100644 index d70df0959..000000000 --- a/docs/tutorials/wiki/src/basiclayout/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'plaster_pastedeploy', - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - 'pyramid_retry', - 'pyramid_tm', - 'pyramid_zodbconn', - 'transaction', - 'ZODB', -] - -tests_require = [ - 'WebTest', - 'pytest', - 'pytest-cov', -] - -setup( - name='tutorial', - version='0.0', - description='myproj', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Pyramid', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(exclude=['tests']), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points={ - 'paste.app_factory': [ - 'main = tutorial:main', - ], - }, -) diff --git a/docs/tutorials/wiki/src/installation/.coveragerc b/docs/tutorials/wiki/src/installation/.coveragerc deleted file mode 100644 index 5db0e79cf..000000000 --- a/docs/tutorials/wiki/src/installation/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = tutorial diff --git a/docs/tutorials/wiki/src/installation/CHANGES.txt b/docs/tutorials/wiki/src/installation/CHANGES.txt deleted file mode 100644 index 14b902fd1..000000000 --- a/docs/tutorials/wiki/src/installation/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version. diff --git a/docs/tutorials/wiki/src/installation/MANIFEST.in b/docs/tutorials/wiki/src/installation/MANIFEST.in index b4624fd1c..131373dc0 100644 --- a/docs/tutorials/wiki/src/installation/MANIFEST.in +++ b/docs/tutorials/wiki/src/installation/MANIFEST.in @@ -1,4 +1,4 @@ -include *.txt *.ini *.cfg *.rst +include *.txt *.ini *.cfg *.md *.toml recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 recursive-include tests * recursive-exclude * __pycache__ diff --git a/docs/tutorials/wiki/src/installation/README.md b/docs/tutorials/wiki/src/installation/README.md new file mode 100644 index 000000000..d0126f5aa --- /dev/null +++ b/docs/tutorials/wiki/src/installation/README.md @@ -0,0 +1,40 @@ +# tutorial + +## Getting Started + +- Change directory into your newly created project if not already there. Your + current directory should be the same as this `README.md` file and `pyproject.toml`. + + ``` + cd tutorial + ``` + +- Create a Python virtual environment, if not already created. + + ``` + python3 -m venv env + ``` + +- Upgrade packaging tools, if necessary. + + ``` + env/bin/pip install --upgrade pip + ``` + +- Install the project in editable mode with its testing requirements. + + ``` + env/bin/pip install -e ".[testing]" + ``` + +- Run your project's tests. + + ``` + env/bin/pytest + ``` + +- Run your project. + + ``` + env/bin/pserve development.ini + ``` diff --git a/docs/tutorials/wiki/src/installation/README.txt b/docs/tutorials/wiki/src/installation/README.txt deleted file mode 100644 index b4a924cc4..000000000 --- a/docs/tutorials/wiki/src/installation/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -myproj -====== - -Getting Started ---------------- - -- Change directory into your newly created project if not already there. Your - current directory should be the same as this README.txt file and setup.py. - - cd tutorial - -- Create a Python virtual environment, if not already created. - - python3 -m venv env - -- Upgrade packaging tools, if necessary. - - env/bin/pip install --upgrade pip setuptools - -- Install the project in editable mode with its testing requirements. - - env/bin/pip install -e ".[testing]" - -- Run your project's tests. - - env/bin/pytest - -- Run your project. - - env/bin/pserve development.ini diff --git a/docs/tutorials/wiki/src/installation/pyproject.toml b/docs/tutorials/wiki/src/installation/pyproject.toml new file mode 100644 index 000000000..ba317b67b --- /dev/null +++ b/docs/tutorials/wiki/src/installation/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +version = "0.0" +name = "tutorial" +authors = [] +description = "tutorial" +readme = "README.md" +keywords = ["web", "pyramid", "pylons"] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", +] +requires-python = ">=3.8" +dependencies = [ + "plaster_pastedeploy", + "pyramid", + "pyramid_chameleon", + "pyramid_debugtoolbar", + "waitress", + "pyramid_retry", + "pyramid_tm", + "pyramid_zodbconn", + "transaction", + "ZODB", +] + +[project.optional-dependencies] +testing = [ + "WebTest", + "pytest", + "pytest-cov", +] + +[project.entry-points."paste.app_factory"] +main = "tutorial:main" + +[tool.setuptools.packages.find] +exclude = ["tests"] + +[tool.coverage.run] +source = [ + "tutorial", +] + +[tool.pytest.ini_options] +addopts = "--strict-markers" +testpaths = [ + "tutorial", + "tests", +] diff --git a/docs/tutorials/wiki/src/installation/pytest.ini b/docs/tutorials/wiki/src/installation/pytest.ini deleted file mode 100644 index 3df78fe9d..000000000 --- a/docs/tutorials/wiki/src/installation/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pytest] -addopts = --strict-markers - -testpaths = - tutorial - tests diff --git a/docs/tutorials/wiki/src/installation/setup.py b/docs/tutorials/wiki/src/installation/setup.py deleted file mode 100644 index d70df0959..000000000 --- a/docs/tutorials/wiki/src/installation/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'plaster_pastedeploy', - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - 'pyramid_retry', - 'pyramid_tm', - 'pyramid_zodbconn', - 'transaction', - 'ZODB', -] - -tests_require = [ - 'WebTest', - 'pytest', - 'pytest-cov', -] - -setup( - name='tutorial', - version='0.0', - description='myproj', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Pyramid', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(exclude=['tests']), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points={ - 'paste.app_factory': [ - 'main = tutorial:main', - ], - }, -) diff --git a/docs/tutorials/wiki/src/models/.coveragerc b/docs/tutorials/wiki/src/models/.coveragerc deleted file mode 100644 index 5db0e79cf..000000000 --- a/docs/tutorials/wiki/src/models/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = tutorial diff --git a/docs/tutorials/wiki/src/models/CHANGES.txt b/docs/tutorials/wiki/src/models/CHANGES.txt deleted file mode 100644 index 14b902fd1..000000000 --- a/docs/tutorials/wiki/src/models/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version. diff --git a/docs/tutorials/wiki/src/models/MANIFEST.in b/docs/tutorials/wiki/src/models/MANIFEST.in index b4624fd1c..131373dc0 100644 --- a/docs/tutorials/wiki/src/models/MANIFEST.in +++ b/docs/tutorials/wiki/src/models/MANIFEST.in @@ -1,4 +1,4 @@ -include *.txt *.ini *.cfg *.rst +include *.txt *.ini *.cfg *.md *.toml recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 recursive-include tests * recursive-exclude * __pycache__ diff --git a/docs/tutorials/wiki/src/models/README.md b/docs/tutorials/wiki/src/models/README.md new file mode 100644 index 000000000..d0126f5aa --- /dev/null +++ b/docs/tutorials/wiki/src/models/README.md @@ -0,0 +1,40 @@ +# tutorial + +## Getting Started + +- Change directory into your newly created project if not already there. Your + current directory should be the same as this `README.md` file and `pyproject.toml`. + + ``` + cd tutorial + ``` + +- Create a Python virtual environment, if not already created. + + ``` + python3 -m venv env + ``` + +- Upgrade packaging tools, if necessary. + + ``` + env/bin/pip install --upgrade pip + ``` + +- Install the project in editable mode with its testing requirements. + + ``` + env/bin/pip install -e ".[testing]" + ``` + +- Run your project's tests. + + ``` + env/bin/pytest + ``` + +- Run your project. + + ``` + env/bin/pserve development.ini + ``` diff --git a/docs/tutorials/wiki/src/models/README.txt b/docs/tutorials/wiki/src/models/README.txt deleted file mode 100644 index b4a924cc4..000000000 --- a/docs/tutorials/wiki/src/models/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -myproj -====== - -Getting Started ---------------- - -- Change directory into your newly created project if not already there. Your - current directory should be the same as this README.txt file and setup.py. - - cd tutorial - -- Create a Python virtual environment, if not already created. - - python3 -m venv env - -- Upgrade packaging tools, if necessary. - - env/bin/pip install --upgrade pip setuptools - -- Install the project in editable mode with its testing requirements. - - env/bin/pip install -e ".[testing]" - -- Run your project's tests. - - env/bin/pytest - -- Run your project. - - env/bin/pserve development.ini diff --git a/docs/tutorials/wiki/src/models/pyproject.toml b/docs/tutorials/wiki/src/models/pyproject.toml new file mode 100644 index 000000000..ba317b67b --- /dev/null +++ b/docs/tutorials/wiki/src/models/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +version = "0.0" +name = "tutorial" +authors = [] +description = "tutorial" +readme = "README.md" +keywords = ["web", "pyramid", "pylons"] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", +] +requires-python = ">=3.8" +dependencies = [ + "plaster_pastedeploy", + "pyramid", + "pyramid_chameleon", + "pyramid_debugtoolbar", + "waitress", + "pyramid_retry", + "pyramid_tm", + "pyramid_zodbconn", + "transaction", + "ZODB", +] + +[project.optional-dependencies] +testing = [ + "WebTest", + "pytest", + "pytest-cov", +] + +[project.entry-points."paste.app_factory"] +main = "tutorial:main" + +[tool.setuptools.packages.find] +exclude = ["tests"] + +[tool.coverage.run] +source = [ + "tutorial", +] + +[tool.pytest.ini_options] +addopts = "--strict-markers" +testpaths = [ + "tutorial", + "tests", +] diff --git a/docs/tutorials/wiki/src/models/pytest.ini b/docs/tutorials/wiki/src/models/pytest.ini deleted file mode 100644 index 3df78fe9d..000000000 --- a/docs/tutorials/wiki/src/models/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pytest] -addopts = --strict-markers - -testpaths = - tutorial - tests diff --git a/docs/tutorials/wiki/src/models/setup.py b/docs/tutorials/wiki/src/models/setup.py deleted file mode 100644 index d70df0959..000000000 --- a/docs/tutorials/wiki/src/models/setup.py +++ /dev/null @@ -1,57 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'plaster_pastedeploy', - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - 'pyramid_retry', - 'pyramid_tm', - 'pyramid_zodbconn', - 'transaction', - 'ZODB', -] - -tests_require = [ - 'WebTest', - 'pytest', - 'pytest-cov', -] - -setup( - name='tutorial', - version='0.0', - description='myproj', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Pyramid', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(exclude=['tests']), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points={ - 'paste.app_factory': [ - 'main = tutorial:main', - ], - }, -) diff --git a/docs/tutorials/wiki/src/tests/.coveragerc b/docs/tutorials/wiki/src/tests/.coveragerc deleted file mode 100644 index 5db0e79cf..000000000 --- a/docs/tutorials/wiki/src/tests/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = tutorial diff --git a/docs/tutorials/wiki/src/tests/CHANGES.txt b/docs/tutorials/wiki/src/tests/CHANGES.txt deleted file mode 100644 index 14b902fd1..000000000 --- a/docs/tutorials/wiki/src/tests/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version. diff --git a/docs/tutorials/wiki/src/tests/MANIFEST.in b/docs/tutorials/wiki/src/tests/MANIFEST.in index b4624fd1c..131373dc0 100644 --- a/docs/tutorials/wiki/src/tests/MANIFEST.in +++ b/docs/tutorials/wiki/src/tests/MANIFEST.in @@ -1,4 +1,4 @@ -include *.txt *.ini *.cfg *.rst +include *.txt *.ini *.cfg *.md *.toml recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 recursive-include tests * recursive-exclude * __pycache__ diff --git a/docs/tutorials/wiki/src/tests/README.md b/docs/tutorials/wiki/src/tests/README.md new file mode 100644 index 000000000..d0126f5aa --- /dev/null +++ b/docs/tutorials/wiki/src/tests/README.md @@ -0,0 +1,40 @@ +# tutorial + +## Getting Started + +- Change directory into your newly created project if not already there. Your + current directory should be the same as this `README.md` file and `pyproject.toml`. + + ``` + cd tutorial + ``` + +- Create a Python virtual environment, if not already created. + + ``` + python3 -m venv env + ``` + +- Upgrade packaging tools, if necessary. + + ``` + env/bin/pip install --upgrade pip + ``` + +- Install the project in editable mode with its testing requirements. + + ``` + env/bin/pip install -e ".[testing]" + ``` + +- Run your project's tests. + + ``` + env/bin/pytest + ``` + +- Run your project. + + ``` + env/bin/pserve development.ini + ``` diff --git a/docs/tutorials/wiki/src/tests/README.txt b/docs/tutorials/wiki/src/tests/README.txt deleted file mode 100644 index b4a924cc4..000000000 --- a/docs/tutorials/wiki/src/tests/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -myproj -====== - -Getting Started ---------------- - -- Change directory into your newly created project if not already there. Your - current directory should be the same as this README.txt file and setup.py. - - cd tutorial - -- Create a Python virtual environment, if not already created. - - python3 -m venv env - -- Upgrade packaging tools, if necessary. - - env/bin/pip install --upgrade pip setuptools - -- Install the project in editable mode with its testing requirements. - - env/bin/pip install -e ".[testing]" - -- Run your project's tests. - - env/bin/pytest - -- Run your project. - - env/bin/pserve development.ini diff --git a/docs/tutorials/wiki/src/tests/pyproject.toml b/docs/tutorials/wiki/src/tests/pyproject.toml new file mode 100644 index 000000000..ba317b67b --- /dev/null +++ b/docs/tutorials/wiki/src/tests/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +version = "0.0" +name = "tutorial" +authors = [] +description = "tutorial" +readme = "README.md" +keywords = ["web", "pyramid", "pylons"] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", +] +requires-python = ">=3.8" +dependencies = [ + "plaster_pastedeploy", + "pyramid", + "pyramid_chameleon", + "pyramid_debugtoolbar", + "waitress", + "pyramid_retry", + "pyramid_tm", + "pyramid_zodbconn", + "transaction", + "ZODB", +] + +[project.optional-dependencies] +testing = [ + "WebTest", + "pytest", + "pytest-cov", +] + +[project.entry-points."paste.app_factory"] +main = "tutorial:main" + +[tool.setuptools.packages.find] +exclude = ["tests"] + +[tool.coverage.run] +source = [ + "tutorial", +] + +[tool.pytest.ini_options] +addopts = "--strict-markers" +testpaths = [ + "tutorial", + "tests", +] diff --git a/docs/tutorials/wiki/src/tests/pytest.ini b/docs/tutorials/wiki/src/tests/pytest.ini deleted file mode 100644 index 3df78fe9d..000000000 --- a/docs/tutorials/wiki/src/tests/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pytest] -addopts = --strict-markers - -testpaths = - tutorial - tests diff --git a/docs/tutorials/wiki/src/tests/setup.py b/docs/tutorials/wiki/src/tests/setup.py deleted file mode 100644 index f619a9915..000000000 --- a/docs/tutorials/wiki/src/tests/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'bcrypt', - 'docutils', - 'plaster_pastedeploy', - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - 'pyramid_retry', - 'pyramid_tm', - 'pyramid_zodbconn', - 'transaction', - 'ZODB', -] - -tests_require = [ - 'WebTest', - 'pytest', - 'pytest-cov', -] - -setup( - name='tutorial', - version='0.0', - description='myproj', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Pyramid', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(exclude=['tests']), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points={ - 'paste.app_factory': [ - 'main = tutorial:main', - ], - }, -) diff --git a/docs/tutorials/wiki/src/views/.coveragerc b/docs/tutorials/wiki/src/views/.coveragerc deleted file mode 100644 index 5db0e79cf..000000000 --- a/docs/tutorials/wiki/src/views/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -source = tutorial diff --git a/docs/tutorials/wiki/src/views/CHANGES.txt b/docs/tutorials/wiki/src/views/CHANGES.txt deleted file mode 100644 index 14b902fd1..000000000 --- a/docs/tutorials/wiki/src/views/CHANGES.txt +++ /dev/null @@ -1,4 +0,0 @@ -0.0 ---- - -- Initial version. diff --git a/docs/tutorials/wiki/src/views/MANIFEST.in b/docs/tutorials/wiki/src/views/MANIFEST.in index b4624fd1c..131373dc0 100644 --- a/docs/tutorials/wiki/src/views/MANIFEST.in +++ b/docs/tutorials/wiki/src/views/MANIFEST.in @@ -1,4 +1,4 @@ -include *.txt *.ini *.cfg *.rst +include *.txt *.ini *.cfg *.md *.toml recursive-include tutorial *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml *.jinja2 recursive-include tests * recursive-exclude * __pycache__ diff --git a/docs/tutorials/wiki/src/views/README.md b/docs/tutorials/wiki/src/views/README.md new file mode 100644 index 000000000..d0126f5aa --- /dev/null +++ b/docs/tutorials/wiki/src/views/README.md @@ -0,0 +1,40 @@ +# tutorial + +## Getting Started + +- Change directory into your newly created project if not already there. Your + current directory should be the same as this `README.md` file and `pyproject.toml`. + + ``` + cd tutorial + ``` + +- Create a Python virtual environment, if not already created. + + ``` + python3 -m venv env + ``` + +- Upgrade packaging tools, if necessary. + + ``` + env/bin/pip install --upgrade pip + ``` + +- Install the project in editable mode with its testing requirements. + + ``` + env/bin/pip install -e ".[testing]" + ``` + +- Run your project's tests. + + ``` + env/bin/pytest + ``` + +- Run your project. + + ``` + env/bin/pserve development.ini + ``` diff --git a/docs/tutorials/wiki/src/views/README.txt b/docs/tutorials/wiki/src/views/README.txt deleted file mode 100644 index b4a924cc4..000000000 --- a/docs/tutorials/wiki/src/views/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -myproj -====== - -Getting Started ---------------- - -- Change directory into your newly created project if not already there. Your - current directory should be the same as this README.txt file and setup.py. - - cd tutorial - -- Create a Python virtual environment, if not already created. - - python3 -m venv env - -- Upgrade packaging tools, if necessary. - - env/bin/pip install --upgrade pip setuptools - -- Install the project in editable mode with its testing requirements. - - env/bin/pip install -e ".[testing]" - -- Run your project's tests. - - env/bin/pytest - -- Run your project. - - env/bin/pserve development.ini diff --git a/docs/tutorials/wiki/src/views/pyproject.toml b/docs/tutorials/wiki/src/views/pyproject.toml new file mode 100644 index 000000000..ba317b67b --- /dev/null +++ b/docs/tutorials/wiki/src/views/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +version = "0.0" +name = "tutorial" +authors = [] +description = "tutorial" +readme = "README.md" +keywords = ["web", "pyramid", "pylons"] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Framework :: Pyramid", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", +] +requires-python = ">=3.8" +dependencies = [ + "plaster_pastedeploy", + "pyramid", + "pyramid_chameleon", + "pyramid_debugtoolbar", + "waitress", + "pyramid_retry", + "pyramid_tm", + "pyramid_zodbconn", + "transaction", + "ZODB", +] + +[project.optional-dependencies] +testing = [ + "WebTest", + "pytest", + "pytest-cov", +] + +[project.entry-points."paste.app_factory"] +main = "tutorial:main" + +[tool.setuptools.packages.find] +exclude = ["tests"] + +[tool.coverage.run] +source = [ + "tutorial", +] + +[tool.pytest.ini_options] +addopts = "--strict-markers" +testpaths = [ + "tutorial", + "tests", +] diff --git a/docs/tutorials/wiki/src/views/pytest.ini b/docs/tutorials/wiki/src/views/pytest.ini deleted file mode 100644 index 3df78fe9d..000000000 --- a/docs/tutorials/wiki/src/views/pytest.ini +++ /dev/null @@ -1,6 +0,0 @@ -[pytest] -addopts = --strict-markers - -testpaths = - tutorial - tests diff --git a/docs/tutorials/wiki/src/views/setup.py b/docs/tutorials/wiki/src/views/setup.py deleted file mode 100644 index 786691e21..000000000 --- a/docs/tutorials/wiki/src/views/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -import os - -from setuptools import setup, find_packages - -here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.txt')) as f: - README = f.read() -with open(os.path.join(here, 'CHANGES.txt')) as f: - CHANGES = f.read() - -requires = [ - 'docutils', - 'plaster_pastedeploy', - 'pyramid', - 'pyramid_chameleon', - 'pyramid_debugtoolbar', - 'waitress', - 'pyramid_retry', - 'pyramid_tm', - 'pyramid_zodbconn', - 'transaction', - 'ZODB', -] - -tests_require = [ - 'WebTest', - 'pytest', - 'pytest-cov', -] - -setup( - name='tutorial', - version='0.0', - description='myproj', - long_description=README + '\n\n' + CHANGES, - classifiers=[ - 'Programming Language :: Python', - 'Framework :: Pyramid', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application', - ], - author='', - author_email='', - url='', - keywords='web pyramid pylons', - packages=find_packages(exclude=['tests']), - include_package_data=True, - zip_safe=False, - extras_require={ - 'testing': tests_require, - }, - install_requires=requires, - entry_points={ - 'paste.app_factory': [ - 'main = tutorial:main', - ], - }, -) -- cgit v1.2.3 From 13909fa1c603028109039e48af096ac4676a0010 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 11:28:25 -0500 Subject: fix: apply equivalent change from old 'setup.py' --- docs/tutorials/wiki/src/authorization/pyproject.toml | 2 ++ docs/tutorials/wiki/src/tests/pyproject.toml | 2 ++ docs/tutorials/wiki/src/views/pyproject.toml | 1 + 3 files changed, 5 insertions(+) diff --git a/docs/tutorials/wiki/src/authorization/pyproject.toml b/docs/tutorials/wiki/src/authorization/pyproject.toml index ba317b67b..5546f8794 100644 --- a/docs/tutorials/wiki/src/authorization/pyproject.toml +++ b/docs/tutorials/wiki/src/authorization/pyproject.toml @@ -18,6 +18,8 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ + "bcrypt", + "docutils", "plaster_pastedeploy", "pyramid", "pyramid_chameleon", diff --git a/docs/tutorials/wiki/src/tests/pyproject.toml b/docs/tutorials/wiki/src/tests/pyproject.toml index ba317b67b..5546f8794 100644 --- a/docs/tutorials/wiki/src/tests/pyproject.toml +++ b/docs/tutorials/wiki/src/tests/pyproject.toml @@ -18,6 +18,8 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ + "bcrypt", + "docutils", "plaster_pastedeploy", "pyramid", "pyramid_chameleon", diff --git a/docs/tutorials/wiki/src/views/pyproject.toml b/docs/tutorials/wiki/src/views/pyproject.toml index ba317b67b..1803f9de7 100644 --- a/docs/tutorials/wiki/src/views/pyproject.toml +++ b/docs/tutorials/wiki/src/views/pyproject.toml @@ -18,6 +18,7 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ + "docutils", "plaster_pastedeploy", "pyramid", "pyramid_chameleon", -- cgit v1.2.3 From 94d5ce60c783eed483d2fff49a6470b066430bfb Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 12:24:11 -0500 Subject: docs: update ZODB wiki tutorial to cookiecutter - Describe 'pyproject.toml' usage (replacing 'setup.py', 'pytest.ini', '.coveragerc'). - Document the new PyPA-blessed build process. --- docs/tutorials/wiki/authorization.rst | 8 ++++---- docs/tutorials/wiki/basiclayout.rst | 2 +- docs/tutorials/wiki/definingviews.rst | 14 +++++++------- docs/tutorials/wiki/distributing.rst | 30 +++++++++++++++++------------- docs/tutorials/wiki/installation.rst | 29 ++++++++++++++++++----------- docs/tutorials/wiki/tests.rst | 2 +- 6 files changed, 48 insertions(+), 37 deletions(-) diff --git a/docs/tutorials/wiki/authorization.rst b/docs/tutorials/wiki/authorization.rst index 2b700ee5b..f7f1be8d0 100644 --- a/docs/tutorials/wiki/authorization.rst +++ b/docs/tutorials/wiki/authorization.rst @@ -38,12 +38,12 @@ Add dependencies ~~~~~~~~~~~~~~~~ Just like in :ref:`wiki_defining_views`, we need a new dependency. -We need to add the `bcrypt `_ package to our tutorial package's ``setup.py`` file by assigning this dependency to the ``requires`` parameter in the ``setup()`` function. +We need to add the `bcrypt `_ package to our tutorial package's ``pyproject.toml`` file by assigning this dependency to the ``dependencies`` stanza. -Open ``setup.py`` and edit it to look like the following: +Open ``pyproject.toml`` and edit it to look like the following: -.. literalinclude:: src/authorization/setup.py - :lines: 11-30 +.. literalinclude:: src/authorization/pyproject.toml + :lines: 20-33 :lineno-match: :emphasize-lines: 2 :language: python diff --git a/docs/tutorials/wiki/basiclayout.rst b/docs/tutorials/wiki/basiclayout.rst index c1c762ae4..01d366e7b 100644 --- a/docs/tutorials/wiki/basiclayout.rst +++ b/docs/tutorials/wiki/basiclayout.rst @@ -15,7 +15,7 @@ Even if empty, this marks a directory as a Python package. We use ``__init__.py`` both as a marker, indicating the directory in which it is contained is a package, and to contain application configuration code. When you run the application using the ``pserve`` command using the ``development.ini`` generated configuration file, the application configuration points at a :term:`Setuptools` :term:`entry point` described as ``egg:tutorial``. -In our application, because the application's ``setup.py`` file says so, this entry point happens to be the ``main`` function within the file named ``__init__.py``. +In our application, because the application's ``pyproject.toml`` file says so, this entry point happens to be the ``main`` function within the file named ``__init__.py``. Open ``tutorial/__init__.py``. It should already contain the following: diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index 02d7bde9a..41d8c13a1 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -27,19 +27,19 @@ We will define several :term:`view callable` functions, then wire them into :app See also the chapter :ref:`resources_chapter` for a complete description of resources and the chapter :ref:`traversal_chapter` for the technical details of how traversal works in Pyramid. -Declaring Dependencies in Our ``setup.py`` File -=============================================== +Declaring Dependencies in Our ``pyproject.toml`` File +===================================================== The view code in our application will depend on a package which is not a dependency of the original "tutorial" application. The original "tutorial" application was generated by the cookiecutter. It does not know about our custom application requirements. -We need to add a dependency on the ``docutils`` package to our ``tutorial`` package's ``setup.py`` file by assigning this dependency to the ``requires`` parameter in the ``setup()`` function. +We need to add a dependency on the ``docutils`` package to our ``tutorial`` package's ``pyproject.toml`` file by assigning this dependency to the ``requires`` parameter in the ``setup()`` function. -Open ``setup.py`` and edit it to look like the following: +Open ``pyproject.toml`` and edit it to look like the following: -.. literalinclude:: src/views/setup.py - :lines: 11-29 +.. literalinclude:: src/views/pyproject.toml + :lines: 20-32 :lineno-match: :emphasize-lines: 2 :language: python @@ -54,7 +54,7 @@ Running ``pip install -e .`` Since a new software dependency was added, you need to run ``pip install -e .`` again inside the root of the ``tutorial`` package to obtain and register the newly added dependency distribution. -Make sure your current working directory is the root of the project (the directory in which ``setup.py`` lives) and execute the following command. +Make sure your current working directory is the root of the project (the directory in which ``pyproject.toml`` lives) and execute the following command. On Unix: diff --git a/docs/tutorials/wiki/distributing.rst b/docs/tutorials/wiki/distributing.rst index c23f79b5a..a423e8b96 100644 --- a/docs/tutorials/wiki/distributing.rst +++ b/docs/tutorials/wiki/distributing.rst @@ -4,33 +4,37 @@ Distributing Your Application ============================= -Once your application works properly, you can create a :term:`distribution` from it by using the ``setup.py sdist`` command. -The following commands assume your current working directory contains the ``tutorial`` package and the ``setup.py`` file. +Once your application works properly, you can create a :term:`distribution` from it by using the PyPA ``build`` command. +The following commands assume your current working directory contains the ``tutorial`` package and its ``pyproject.toml`` file. On Unix: .. code-block:: bash - $VENV/bin/python setup.py sdist + $VENV/bin/pip install build + $VENV/bin/python -m build On Windows: .. code-block:: doscon - %VENV%\Scripts\python setup.py sdist + %VENV%\Scripts\pip install build + %VENV%\Scripts\python -m build The output of such a command will be something like: .. code-block:: text - running sdist - # more output - creating dist - Creating tar archive - removing 'tutorial-0.0' (and everything under it) + * Creating venv isolated environment... + * Installing packages in isolated environment... (setuptools) + * Getting build dependencies for sdist... + ... + removing build/bdist.linux-x86_64/wheel + Successfully built tutorial-0.0.tar.gz and tutorial-0.0-py3-none-any.whl + This command creates a subdirectory named ``dist``. -Inside that is a tarball named ``tutorial-0.0.tar.gz``, which is the :term:`distribution` of your application. -You can send this file to your friends to show them your cool new application. -They should be able to install it by pointing the ``pip install`` command directly at it. -Or you can upload it to `PyPI `_ and share it with the rest of the world, where it can be downloaded via ``pip install`` remotely like any other package people download from PyPI. +Inside that is a tarball named ``tutorial-0.0.tar.gz`` (the source :term:`distribution` of your application), as well ass ``tutorial-0.0-py3-none-any.whl`` (the binary :term:`distribution`). +You can send these files to your friends to show them your cool new application. +They should be able to install the app by pointing the ``pip install`` command directly at one of them. +Or you can upload them to `PyPI `_ and share them with the rest of the world, where it can be downloaded via ``pip install`` remotely like any other package people download from PyPI. diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index ce15bff0e..e83e83861 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -187,17 +187,12 @@ The console will show ``pip`` checking for packages and installing missing packa Successfully installed BTrees-4.7.2 Chameleon-3.8.1 Mako-1.1.3 MarkupSafe-1.1.1 PasteDeploy-2.1.1 Pygments-2.7.3 WebTest-2.0.35 ZConfig-3.5.0 ZEO-5.2.2 ZODB-5.6.0 attrs-20.3.0 beautifulsoup4-4.9.3 cffi-1.14.4 coverage-5.3.1 hupper-1.10.2 iniconfig-1.1.1 packaging-20.8 persistent-4.6.4 plaster-1.0 plaster-pastedeploy-0.7 pluggy-0.13.1 py-1.10.0 pycparser-2.20 pyparsing-2.4.7 pyramid-1.10.5 pyramid-chameleon-0.3 pyramid-debugtoolbar-4.9 pyramid-mako-1.1.0 pyramid-retry-2.1.1 pyramid-tm-2.4 pyramid-zodbconn-0.8.1 pytest-6.2.1 pytest-cov-2.10.1 repoze.lru-0.7 six-1.15.0 soupsieve-2.1 toml-0.10.2 transaction-3.0.1 translationstring-1.4 tutorial venusian-3.0.0 waitress-1.4.4 webob-1.8.6 zc.lockfile-2.0 zdaemon-4.3 zodbpickle-2.0.0 zodburi-2.4.0 zope.deprecation-4.4.0 zope.interface-5.2.0 -Testing requirements are defined in our project's ``setup.py`` file, in the ``tests_require`` and ``extras_require`` stanzas. +Testing requirements are defined in our project's ``pyproject.toml`` file, in the ``project:optional-dependencies`` stanza: -.. literalinclude:: src/installation/setup.py +.. literalinclude:: src/installation/pyproject.toml :language: python :lineno-match: - :lines: 24-28 - -.. literalinclude:: src/installation/setup.py - :language: python - :lineno-match: - :lines: 48-50 + :lines: 33-38 .. _running_tests: @@ -295,10 +290,22 @@ Test and coverage cookiecutter defaults --------------------------------------- The Pyramid cookiecutter includes configuration defaults for ``pytest`` and test coverage. -These configuration files are ``pytest.ini`` and ``.coveragerc``, located at the root of your package. +These configuration optionas are defined in stanzas of the ``pyroject.toml`` file. + +The ``tool.pytest.ini_options`` stanza follows :ref:`conventions for Python test discovery `. +The configuration defaults from the cookiecutter tell ``pytest`` where to find the module on which we want to run tests: + +.. literalinclude:: src/installation/pyproject.toml + :language: python + :lineno-match: + :lines: 51-56 + +The ``tool.coverage.run`` stanza defines the code for which we want to collect and report coverage: -``pytest`` follows :ref:`conventions for Python test discovery `. -The configuration defaults from the cookiecutter tell ``pytest`` where to find the module on which we want to run tests and coverage. +.. literalinclude:: src/installation/pyproject.toml + :language: python + :lineno-match: + :lines: 46-49 .. seealso:: See ``pytest``'s documentation for :ref:`pytest:usage` or invoke ``pytest -h`` to see its full set of options. diff --git a/docs/tutorials/wiki/tests.rst b/docs/tutorials/wiki/tests.rst index 231945c9a..f9359dd38 100644 --- a/docs/tutorials/wiki/tests.rst +++ b/docs/tutorials/wiki/tests.rst @@ -28,7 +28,7 @@ The harness consists of the following setup: - ``testing.ini`` - a mirror of ``development.ini`` and ``production.ini`` that contains settings used for executing the test suite. Most importantly, it contains the database connection information used by tests that require the database. -- ``tests_require`` in ``setup.py`` - controls the dependencies installed when testing. +- ``project.optional-dependencies`` in ``pyproject.toml`` - controls the dependencies installed when testing. When the list is changed, it is necessary to re-run ``$VENV/bin/pip install -e ".[testing]"`` to ensure the new dependencies are installed. - ``tests/conftest.py`` - the core fixtures available throughout our tests. -- cgit v1.2.3 From 60b4dc9e3c072dc01e5a11dedeae225f331a2980 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 20:57:36 -0500 Subject: fix: remove stray mentions of 'setup.py' --- docs/tutorials/wiki/definingviews.rst | 2 +- docs/tutorials/wiki/design.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/wiki/definingviews.rst b/docs/tutorials/wiki/definingviews.rst index 41d8c13a1..b0368bddf 100644 --- a/docs/tutorials/wiki/definingviews.rst +++ b/docs/tutorials/wiki/definingviews.rst @@ -34,7 +34,7 @@ The view code in our application will depend on a package which is not a depende The original "tutorial" application was generated by the cookiecutter. It does not know about our custom application requirements. -We need to add a dependency on the ``docutils`` package to our ``tutorial`` package's ``pyproject.toml`` file by assigning this dependency to the ``requires`` parameter in the ``setup()`` function. +We need to add a dependency on the ``docutils`` package to our ``tutorial`` package's ``pyproject.toml`` file by assigning this dependency to its ``dependencies`` stanza. Open ``pyproject.toml`` and edit it to look like the following: diff --git a/docs/tutorials/wiki/design.rst b/docs/tutorials/wiki/design.rst index 5c86293f6..9c03d4bdc 100644 --- a/docs/tutorials/wiki/design.rst +++ b/docs/tutorials/wiki/design.rst @@ -12,7 +12,7 @@ Overall We choose to use :term:`reStructuredText` markup in the wiki text. Conversion from reStructuredText to HTML is provided by the widely used ``docutils`` Python module. -We will add this module in the dependency list on the project ``setup.py`` file. +We will add this module in the dependency list on the project's ``pyproject.toml`` file. Models -- cgit v1.2.3 From 48d224cd63b4497d4b798c3a2583f2611dfaa54e Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 20:58:53 -0500 Subject: fix: document test harness config via 'pyproject.toml' --- docs/tutorials/wiki/tests.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/tutorials/wiki/tests.rst b/docs/tutorials/wiki/tests.rst index f9359dd38..70eb3c1da 100644 --- a/docs/tutorials/wiki/tests.rst +++ b/docs/tutorials/wiki/tests.rst @@ -19,19 +19,19 @@ The test module would have the same name with the prefix ``test_``. The harness consists of the following setup: -- ``pytest.ini`` - controls basic ``pytest`` configuration, including where to find the tests. +- The ``project.optional-dependencies`` stanza of ``pyproject.toml`` - controls the dependencies installed when testing. + When the list is changed, it is necessary to re-run ``$VENV/bin/pip install -e ".[testing]"`` to ensure the new dependencies are installed. + +- The ``tool.pytest.ini_options`` stanza of ``pyproject.toml`` controls basic ``pytest`` configuration, including where to find the tests. We have configured ``pytest`` to search for tests in the application package and in the ``tests`` package. -- ``.coveragerc`` - controls coverage config. +- The ``tool.coverage.run`` stanza of ``pyproject.toml`` controls coverage config. In our setup, it works with the ``pytest-cov`` plugin that we use via the ``--cov`` options to the ``pytest`` command. -- ``testing.ini`` - a mirror of ``development.ini`` and ``production.ini`` that contains settings used for executing the test suite. +- The ``testing.ini`` file is a mirror of ``development.ini`` and ``production.ini`` that contains settings used for executing the test suite. Most importantly, it contains the database connection information used by tests that require the database. -- ``project.optional-dependencies`` in ``pyproject.toml`` - controls the dependencies installed when testing. - When the list is changed, it is necessary to re-run ``$VENV/bin/pip install -e ".[testing]"`` to ensure the new dependencies are installed. - -- ``tests/conftest.py`` - the core fixtures available throughout our tests. +- The ``tests/conftest.py`` file defines the core fixtures available throughout our tests. The fixtures are explained in more detail in the following sections. Open ``tests/conftest.py`` and follow along. -- cgit v1.2.3 From d3987fc46c2a52eb7521bb4849c375751ac9ecad Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 21:01:59 -0500 Subject: docs: fold in 'Distributing' language from the 'wiki2' refresh (PR #3747) --- docs/tutorials/wiki/distributing.rst | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/wiki/distributing.rst b/docs/tutorials/wiki/distributing.rst index a423e8b96..4ad7ffb9f 100644 --- a/docs/tutorials/wiki/distributing.rst +++ b/docs/tutorials/wiki/distributing.rst @@ -4,8 +4,16 @@ Distributing Your Application ============================= -Once your application works properly, you can create a :term:`distribution` from it by using the PyPA ``build`` command. -The following commands assume your current working directory contains the ``tutorial`` package and its ``pyproject.toml`` file. +.. note:: + + This is an optional step. + It is not required nor expected that every application is built to be distributed to a package index. + However, even when building personal projects, defining it as a distributable artifact can provide many advantages when it comes to optimizing your build for a Docker image or other "production" hardened environments that should not mirror your local development environment exactly. + +Once your application works properly, you can create a "sdist" or "wheel" from +it by using a PEP517-compliant client tool. The following commands assume your +current working directory contains the ``tutorial`` package and the +``pyproject.toml`` file. On Unix: @@ -32,9 +40,14 @@ The output of such a command will be something like: removing build/bdist.linux-x86_64/wheel Successfully built tutorial-0.0.tar.gz and tutorial-0.0-py3-none-any.whl - This command creates a subdirectory named ``dist``. Inside that is a tarball named ``tutorial-0.0.tar.gz`` (the source :term:`distribution` of your application), as well ass ``tutorial-0.0-py3-none-any.whl`` (the binary :term:`distribution`). You can send these files to your friends to show them your cool new application. They should be able to install the app by pointing the ``pip install`` command directly at one of them. -Or you can upload them to `PyPI `_ and share them with the rest of the world, where it can be downloaded via ``pip install`` remotely like any other package people download from PyPI. +These artifacts are also uploadable to `PyPI `_, or another package index, using a tool like ``twine``. + +Note that the config files, such as ``production.ini`` are not part of the distribution. +These files are considered to be defined by the "user" of your application and not part of the application itself. +If you'd like to help a user out, consider defining a new CLI script similar to ``initialize_tutorial_db`` that can render a config file for them! + +Please learn more about distributing an application from the `Python Packaging User Guide `_. -- cgit v1.2.3 From fea81c0cf25402c7088b002be7a1672d29841345 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Wed, 7 Feb 2024 21:09:20 -0500 Subject: docs: fold in 'Installing' language from the 'wiki2' refresh (PR #3747) --- docs/tutorials/wiki/installation.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/wiki/installation.rst b/docs/tutorials/wiki/installation.rst index e83e83861..4dc732aca 100644 --- a/docs/tutorials/wiki/installation.rst +++ b/docs/tutorials/wiki/installation.rst @@ -290,9 +290,11 @@ Test and coverage cookiecutter defaults --------------------------------------- The Pyramid cookiecutter includes configuration defaults for ``pytest`` and test coverage. -These configuration optionas are defined in stanzas of the ``pyroject.toml`` file. +The configuration for ``pytest`` is in the ``pyroject.toml`` file in the ``tool.pytest.ini_options`` stanza. +Coverage is checked using the ``pytest--cov`` plugin, a wrapper around the `Coverage `_ tool. +Options affecting coverage are defined in the ``[tool.coverage.run]`` stanza of ``pyproject.toml``. -The ``tool.pytest.ini_options`` stanza follows :ref:`conventions for Python test discovery `. +``pytest`` follows :ref:`conventions for Python test discovery `. The configuration defaults from the cookiecutter tell ``pytest`` where to find the module on which we want to run tests: .. literalinclude:: src/installation/pyproject.toml -- cgit v1.2.3