From b1a0f038bfe61d62cee3c2c98ceb608900aa1549 Mon Sep 17 00:00:00 2001 From: cclauss Date: Tue, 13 Jun 2017 09:47:22 +0200 Subject: [PATCH 01/83] 'Programming Language :: Python :: 3.6', --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index d8fc8971..644f8a05 100644 --- a/setup.py +++ b/setup.py @@ -61,6 +61,7 @@ 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', ], # What does your project relate to? From e3d3c38ea66b6ff88d3dde6bd8e03c8edeb5f007 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 12 Dec 2017 14:57:59 -0600 Subject: [PATCH 02/83] Drop Python 3.3 --- .travis.yml | 1 - setup.py | 1 - tox.ini | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 73cfbf58..411ec8da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ language: python env: - TOXENV=py27 - - TOXENV=py33 - TOXENV=py34 install: pip install tox diff --git a/setup.py b/setup.py index 644f8a05..75e1030b 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff --git a/tox.ini b/tox.ini index 3d85a0da..1c0fd497 100644 --- a/tox.ini +++ b/tox.ini @@ -11,12 +11,11 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{27,33,34} +envlist = py{27,34} [testenv] basepython = py27: python2.7 - py33: python3.3 py34: python3.4 deps = check-manifest From 4eabd46282b0e5b60e84df741ef948075bbc74f2 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 12 Dec 2017 15:33:40 -0600 Subject: [PATCH 03/83] Fix Travis config --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 411ec8da..3596a63f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,12 @@ language: python -env: - - TOXENV=py27 - - TOXENV=py34 +matrix: + include: + - python: 2.7 + env: TOXENV=py27 + - python: 3.4 + env: TOXENV=py34 install: pip install tox From e0a01a06aabb70600d07e5b1014972d64c5f7d70 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 12 Dec 2017 14:58:14 -0600 Subject: [PATCH 04/83] Test against 3.5 and 3.6 --- .travis.yml | 4 ++++ tox.ini | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3596a63f..3ec1a266 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,10 @@ matrix: env: TOXENV=py27 - python: 3.4 env: TOXENV=py34 + - python: 3.5 + env: TOXENV=py35 + - python: 3.6 + env: TOXENV=py36 install: pip install tox diff --git a/tox.ini b/tox.ini index 1c0fd497..b3f7fa58 100644 --- a/tox.ini +++ b/tox.ini @@ -11,12 +11,14 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{27,34} +envlist = py{27,34,35,36} [testenv] basepython = py27: python2.7 py34: python3.4 + py35: python3.5 + py36: python3.6 deps = check-manifest readme_renderer From 61356d4865d873a3554bab1f70311cb8d7a865b3 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 12 Dec 2017 17:02:43 -0600 Subject: [PATCH 05/83] Update README to direct readers to setup.py --- README.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.rst b/README.rst index c315711d..d2f04a00 100644 --- a/README.rst +++ b/README.rst @@ -9,6 +9,13 @@ This projects does not aim to cover best practices for Python project development as a whole. For example, it does not provide guidance or tool recommendations for version control, documentation, or testing. +`The source for this project is available here +`_. + +Most of the configuration for a Python project is done in the ``setup.py`` +file, an example of which is included in this project. You should edit this +file accordingly to adapt this sample project to your needs. + ---- This is the README file for the project. From 8566959c4a33cb677b75bf4ce35eef1eb255a5ee Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 12 Dec 2017 17:03:00 -0600 Subject: [PATCH 06/83] Add more comments to setup.py --- setup.py | 138 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 95 insertions(+), 43 deletions(-) diff --git a/setup.py b/setup.py index 75e1030b..9f29a907 100644 --- a/setup.py +++ b/setup.py @@ -17,29 +17,65 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() -setup( - name='sample', +# Arguments marked as "Required" below must be included for upload to PyPI. +# Fields marked as "Optional" may be commented out. - # Versions should comply with PEP440. For a discussion on single-sourcing - # the version across setup.py and the project code, see +setup( + # This is the name of your project. The first time you publish this + # package, this name will be registered for you. It will determine how + # users can install this project, e.g.: + # + # $ pip install sampleproject + # + # And where it will live on PyPI: https://pypi.org/project/sampleproject/ + # + # There are some restrictions on what makes a valid project name + # specification here: + # https://packaging.python.org/specifications/core-metadata/#name + name='sampleproject', # Required + + # Versions should comply with PEP 440: + # https://www.python.org/dev/peps/pep-0440/ + # + # For a discussion on single-sourcing the version across setup.py and the + # project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.2.0', - - description='A sample Python project', - long_description=long_description, - - # The project's main homepage. - url='https://github.com/pypa/sampleproject', - - # Author details - author='The Python Packaging Authority', - author_email='pypa-dev@googlegroups.com', - - # Choose your license - license='MIT', - - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ + version='1.2.0', # Required + + # This is a one-line description or tagline of what your project does. This + # corresponds to the "Summary" metadata field: + # https://packaging.python.org/specifications/core-metadata/#summary + description='A sample Python project', # Required + + # This is an optional longer description of your project that represents + # the body of text which users will see when they visit PyPI. + # + # Often, this is the same as your README, so you can just read it in from + # that file directly (as we have already done above) + # + # This field corresponds to the "Description" metadata field: + # https://packaging.python.org/specifications/core-metadata/#description-optional + long_description=long_description, # Optional + + # This should be a valid link to your project's main homepage. + # + # This field corresponds to the "Home-Page" metadata field: + # https://packaging.python.org/specifications/core-metadata/#home-page-optional + url='https://github.com/pypa/sampleproject', # Optional + + # This should be your name or the name of the organization which owns the + # project. + author='The Python Packaging Authority', # Optional + + # This should be a valid email address corresponding to the author listed + # above. + author_email='pypa-dev@googlegroups.com', # Optional + + # Classifiers help users find your project by categorizing it. + # + # For a list of valid classifiers, see + # https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ # Optional # How mature is this project? Common values are # 3 - Alpha # 4 - Beta @@ -63,49 +99,65 @@ 'Programming Language :: Python :: 3.6', ], - # What does your project relate to? - keywords='sample setuptools development', + # This field adds keywords for your project which will appear on the + # project page. What does your project relate to? + # + # Note that this is a string of words separated by whitespace, not a list. + keywords='sample setuptools development', # Optional - # You can just specify the packages manually here if your project is + # You can just specify package directories manually here if your project is # simple. Or you can use find_packages(). - packages=find_packages(exclude=['contrib', 'docs', 'tests']), - - # Alternatively, if you want to distribute just a my_module.py, uncomment - # this: + # + # Alternatively, if you just want to distribute a single Python file, + # uncomment this, which will expect a file called `my_module.py` to exist: # py_modules=["my_module"], + packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required - # List run-time dependencies here. These will be installed by pip when - # your project is installed. For an analysis of "install_requires" vs pip's - # requirements files see: + # This field lists other packages that your project depends on to run. + # Any package you put here will be installed by pip when your project is + # installed, so they must be valid existing projects. + # + # For an analysis of "install_requires" vs pip's requirements files see: # https://packaging.python.org/en/latest/requirements.html - install_requires=['peppercorn'], + install_requires=['peppercorn'], # Optional # List additional groups of dependencies here (e.g. development - # dependencies). You can install these using the following syntax, - # for example: - # $ pip install -e .[dev,test] - extras_require={ + # dependencies). Users will be able to install these using the "extras" + # syntax, for example: + # + # $ pip install sampleproject[dev] + # + # Similar to `install_requires` above, these must be valid existing + # projects. + extras_require={ # Optional 'dev': ['check-manifest'], 'test': ['coverage'], }, # If there are data files included in your packages that need to be - # installed, specify them here. If using Python 2.6 or less, then these - # have to be included in MANIFEST.in as well. - package_data={ + # installed, specify them here. + # + # If using Python 2.6 or less, then these have to be included in + # MANIFEST.in as well. + package_data={ # Optional 'sample': ['package_data.dat'], }, # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: - # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa + # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files + # # In this case, 'data_file' will be installed into '/my_data' - data_files=[('my_data', ['data/data_file'])], + data_files=[('my_data', ['data/data_file'])], # Optional # To provide executable scripts, use entry points in preference to the # "scripts" keyword. Entry points provide cross-platform support and allow - # pip to create the appropriate form of executable for the target platform. - entry_points={ + # `pip` to create the appropriate form of executable for the target + # platform. + # + # For example, the following would provide a command called `sample` which + # executes the function `main` from this package when invoked: + entry_points={ # Optional 'console_scripts': [ 'sample=sample:main', ], From df022c4dc79c9026b66e886ea350f8f4e37ce69e Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 12 Dec 2017 17:31:31 -0600 Subject: [PATCH 07/83] Address feedback --- setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 9f29a907..98b2c5ff 100644 --- a/setup.py +++ b/setup.py @@ -108,9 +108,12 @@ # You can just specify package directories manually here if your project is # simple. Or you can use find_packages(). # - # Alternatively, if you just want to distribute a single Python file, - # uncomment this, which will expect a file called `my_module.py` to exist: + # Alternatively, if you just want to distribute a single Python file, use + # the `py_modules` argument instead as follows, which will expect a file + # called `my_module.py` to exist: + # # py_modules=["my_module"], + # packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required # This field lists other packages that your project depends on to run. @@ -137,7 +140,7 @@ # If there are data files included in your packages that need to be # installed, specify them here. # - # If using Python 2.6 or less, then these have to be included in + # If using Python 2.6 or earlier, then these have to be included in # MANIFEST.in as well. package_data={ # Optional 'sample': ['package_data.dat'], From 0fb3b13b9a69536324ef554652cecababdde71dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20S=C3=B8ndergaard?= Date: Tue, 19 Dec 2017 14:20:07 +0100 Subject: [PATCH 08/83] Added license field The license field is referred to in the classifiers section, but wasn't specified anywhere in the example. This commit adds the license field. --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index 98b2c5ff..e51c76ad 100644 --- a/setup.py +++ b/setup.py @@ -70,6 +70,9 @@ # This should be a valid email address corresponding to the author listed # above. author_email='pypa-dev@googlegroups.com', # Optional + + # This is the license of your project. + license='MIT', # Classifiers help users find your project by categorizing it. # From a0568c51325dc9e52b1629e6b7bf67f8a7242e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20S=C3=B8ndergaard?= Date: Tue, 19 Dec 2017 14:42:26 +0100 Subject: [PATCH 09/83] Fix linting errors --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e51c76ad..05f8c511 100644 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ # This should be a valid email address corresponding to the author listed # above. author_email='pypa-dev@googlegroups.com', # Optional - + # This is the license of your project. license='MIT', From 4ac29396ad27661533608175f7b0c1058df86cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20S=C3=B8ndergaard?= Date: Wed, 20 Dec 2017 10:15:16 +0100 Subject: [PATCH 10/83] Removed reference to license field --- setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 05f8c511..8b41ed7a 100644 --- a/setup.py +++ b/setup.py @@ -71,9 +71,6 @@ # above. author_email='pypa-dev@googlegroups.com', # Optional - # This is the license of your project. - license='MIT', - # Classifiers help users find your project by categorizing it. # # For a list of valid classifiers, see @@ -89,7 +86,7 @@ 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', - # Pick your license as you wish (should match "license" above) + # Pick your license as you wish 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure From e92f8d6f0a1f0d916ab8a507ef764dbc4e456a88 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Fri, 5 Jan 2018 10:54:05 +0000 Subject: [PATCH 11/83] Reword comment in setup.cfg --- setup.cfg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 79bc6784..9886c7c6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [bdist_wheel] -# This flag says that the code is written to work on both Python 2 and Python -# 3. If at all possible, it is good practice to do this. If you cannot, you -# will need to generate wheels for each Python version that you support. +# This flag says to generate wheels that support both Python 2 and Python +# 3. If your code will not run unchanged on both Python 2 and 3, you will +# need to generate separate wheels for each Python version that you +# support. universal=1 From 4d0e97155741594a12ad6cd43bf166ac7115075b Mon Sep 17 00:00:00 2001 From: Sebastian Bank Date: Wed, 10 Jan 2018 13:01:49 +0100 Subject: [PATCH 12/83] Include LICENSE.txt in wheel --- setup.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.cfg b/setup.cfg index 9886c7c6..75e201ac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,7 @@ +[metadata] +# This includes the license file in the wheel. +license_file = LICENSE.txt + [bdist_wheel] # This flag says to generate wheels that support both Python 2 and Python # 3. If your code will not run unchanged on both Python 2 and 3, you will From de866666a88d3819740351d5a5e720dacf367f23 Mon Sep 17 00:00:00 2001 From: Philip James Date: Wed, 21 Feb 2018 10:23:34 -0800 Subject: [PATCH 13/83] Add and document the `project_urls` field. This field corresponds to https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use and better documentation in the sampleproject will hopefully encourage use. --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 8b41ed7a..04406cc3 100644 --- a/setup.py +++ b/setup.py @@ -165,4 +165,16 @@ 'sample=sample:main', ], }, + + # List additional URLs that are relevant to your project as a dict. + # + # This field corresponds to the "Project-URL" metadata fields: + # https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use + # + # Examples listed include a pattern for specifying where the package + # maintainers would like thanks given or funding support. + project_urls={ # Optional + 'funding': 'https://donate.pypi.org', + 'thanks': 'http://saythanks.io/to/example' + }, ) From 8fc690c911cf46a177484799c16b71e54f706e0e Mon Sep 17 00:00:00 2001 From: Philip James Date: Wed, 21 Feb 2018 12:01:39 -0800 Subject: [PATCH 14/83] Document the relationship between dict key and link text, add more examples --- setup.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 04406cc3..3eff49b7 100644 --- a/setup.py +++ b/setup.py @@ -171,10 +171,14 @@ # This field corresponds to the "Project-URL" metadata fields: # https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use # - # Examples listed include a pattern for specifying where the package - # maintainers would like thanks given or funding support. + # Examples listed include a pattern for specifying where the package tracks + # issues, where the source is hosted, where to say thanks to the package + # maintainers, and where to support the project financially. The key is + # what's used to render the link text on PyPI. project_urls={ # Optional - 'funding': 'https://donate.pypi.org', - 'thanks': 'http://saythanks.io/to/example' + 'Bug Reports': 'https://github.com/pypa/sampleproject/issues', + 'Funding': 'https://donate.pypi.org', + 'Say Thanks!': 'http://saythanks.io/to/example', + 'Source': 'https://github.com/pypa/sampleproject/', }, ) From d5dcff4b49a230ea27fb143fce123688138686a3 Mon Sep 17 00:00:00 2001 From: Philip James Date: Wed, 21 Feb 2018 12:05:15 -0800 Subject: [PATCH 15/83] Fix trailing whitespace --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3eff49b7..27227e0b 100644 --- a/setup.py +++ b/setup.py @@ -172,7 +172,7 @@ # https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use # # Examples listed include a pattern for specifying where the package tracks - # issues, where the source is hosted, where to say thanks to the package + # issues, where the source is hosted, where to say thanks to the package # maintainers, and where to support the project financially. The key is # what's used to render the link text on PyPI. project_urls={ # Optional From 5be097071c83c935777bde117fa85cd1f64c690a Mon Sep 17 00:00:00 2001 From: Rebecca Turner <637275@gmail.com> Date: Sat, 17 Mar 2018 11:58:20 -0400 Subject: [PATCH 16/83] Migrated README to Markdown (PEP 566) Migrated `README.rst` to `README.md` and updated `setup.py` to match; this is in line with PEP 566 and the new long_description_content_type arg in setuptools. Also updated `MANIFEST.in` to include the new `README.md`. See: * [Relevant section in PEP 566](https://www.python.org/dev/peps/pep-0566/#description-content-type-optional) * [The CommonMark specification](http://spec.commonmark.org) * [The Description-Content-Type field documentation in the Python packaging documentation](https://packaging.python.org/specifications/core-metadata/#description-content-type-optional) --- MANIFEST.in | 3 +++ README.md | 37 +++++++++++++++++++++++++++++++++++++ README.rst | 32 -------------------------------- setup.py | 9 ++++++++- 4 files changed, 48 insertions(+), 33 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/MANIFEST.in b/MANIFEST.in index a4fa0c0d..c066bbd4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,6 @@ +# Include the README +include *.md + # Include the license file include LICENSE.txt diff --git a/README.md b/README.md new file mode 100644 index 00000000..3fb999a7 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ +# A sample Python project + +A sample project that exists as an aid to the [Python Packaging User +Guide][packaging guide]’s [Tutorial on Packaging and Distributing +Projects][distribution tutorial]. + +This projects does not aim to cover best practices for Python project +development as a whole. For example, it does not provide guidance or tool +recommendations for version control, documentation, or testing. + +[The source for this project is available here][src]. + +Most of the configuration for a Python project is done in the `setup.py` file, +an example of which is included in this project. You should edit this file +accordingly to adapt this sample project to your needs. + +---- + +This is the README file for the project. + +The file should use UTF-8 encoding and can be written using +[reStructuredText][rst] or [markdown][md use] with the appropriate [key set][md +use]. It will be used to generate the project webpage on PyPI and will be +displayed as the project homepage on common code-hosting services, and should be +written for that purpose. + +Typical contents for this file would include an overview of the project, basic +usage examples, etc. Generally, including the project changelog in here is not a +good idea, although a simple “What's New” section for the most recent version +may be appropriate. + +[packaging guide]: https://twitter.com/mcclure111/status/975031304742895616 +[distribution tutorial]: https://twitter.com/mcclure111/status/975031304742895616 +[src]: https://twitter.com/mcclure111/status/975031304742895616 +[rst]: https://twitter.com/mcclure111/status/975031304742895616 +[md]: https://tools.ietf.org/html/rfc7764#section-3.5 "CommonMark variant" +[md use]: https://packaging.python.org/specifications/core-metadata/#description-content-type-optional diff --git a/README.rst b/README.rst deleted file mode 100644 index d2f04a00..00000000 --- a/README.rst +++ /dev/null @@ -1,32 +0,0 @@ -A sample Python project -======================= - -A sample project that exists as an aid to the `Python Packaging User Guide -`_'s `Tutorial on Packaging and Distributing -Projects `_. - -This projects does not aim to cover best practices for Python project -development as a whole. For example, it does not provide guidance or tool -recommendations for version control, documentation, or testing. - -`The source for this project is available here -`_. - -Most of the configuration for a Python project is done in the ``setup.py`` -file, an example of which is included in this project. You should edit this -file accordingly to adapt this sample project to your needs. - ----- - -This is the README file for the project. - -The file should use UTF-8 encoding and be written using `reStructuredText -`_. It -will be used to generate the project webpage on PyPI and will be displayed as -the project homepage on common code-hosting services, and should be written for -that purpose. - -Typical contents for this file would include an overview of the project, basic -usage examples, etc. Generally, including the project changelog in here is not -a good idea, although a simple "What's New" section for the most recent version -may be appropriate. diff --git a/setup.py b/setup.py index 27227e0b..254ebd04 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ here = path.abspath(path.dirname(__file__)) # Get the long description from the README file -with open(path.join(here, 'README.rst'), encoding='utf-8') as f: +with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() # Arguments marked as "Required" below must be included for upload to PyPI. @@ -57,6 +57,13 @@ # https://packaging.python.org/specifications/core-metadata/#description-optional long_description=long_description, # Optional + # Denotes that our long_description is in Markdown; valid values are + # text/plain, text/x-rst, and text/markdown + # + # This field corresponds to the "Description-Content-Type" metadata field: + # https://packaging.python.org/specifications/core-metadata/#description-content-type-optional + long_description_content_type='text/markdown', # Optional + # This should be a valid link to your project's main homepage. # # This field corresponds to the "Home-Page" metadata field: From 10bef87464422245a05a093cf44e73b2bf4d0248 Mon Sep 17 00:00:00 2001 From: Rebecca Turner <637275@gmail.com> Date: Tue, 20 Mar 2018 01:00:31 -0400 Subject: [PATCH 17/83] Clarified when content_type is optional Added a comment clarifying that `long_description_content_type` in `setup()` is only optional if the `long_description` is written in RST and a quote from relevant documentation. --- setup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.py b/setup.py index 254ebd04..d285c7eb 100644 --- a/setup.py +++ b/setup.py @@ -60,6 +60,11 @@ # Denotes that our long_description is in Markdown; valid values are # text/plain, text/x-rst, and text/markdown # + # Optional if long_description is written in rst but required for + # plain-text or Markdown; if unspecified, "applications should attempt to + # render [the long_description] as text/x-rst; charset=UTF-8 and fall back + # to text/plain if it is not valid rst" (see link below) + # # This field corresponds to the "Description-Content-Type" metadata field: # https://packaging.python.org/specifications/core-metadata/#description-content-type-optional long_description_content_type='text/markdown', # Optional From 79b599a8911ab89544f4115816868bc956aa17e9 Mon Sep 17 00:00:00 2001 From: Rebecca Turner <637275@gmail.com> Date: Tue, 20 Mar 2018 02:00:25 -0400 Subject: [PATCH 18/83] Typos and clarifications * Changed true quotes to ASCII quotes in `README.md` * Fixed a typo (`This projects` instead of `This project`) in `README.md` * Changed `rst` to `reStructuredText (rst)` in `setup.py` for people who might not be familiar with the format * Added small note to `# Optional` comment on the `long_description_content_type` arg in `setup.py:L70` --- README.md | 4 ++-- setup.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3fb999a7..03c8eca1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # A sample Python project A sample project that exists as an aid to the [Python Packaging User -Guide][packaging guide]’s [Tutorial on Packaging and Distributing +Guide][packaging guide]'s [Tutorial on Packaging and Distributing Projects][distribution tutorial]. -This projects does not aim to cover best practices for Python project +This project does not aim to cover best practices for Python project development as a whole. For example, it does not provide guidance or tool recommendations for version control, documentation, or testing. diff --git a/setup.py b/setup.py index d285c7eb..312248b7 100644 --- a/setup.py +++ b/setup.py @@ -60,14 +60,14 @@ # Denotes that our long_description is in Markdown; valid values are # text/plain, text/x-rst, and text/markdown # - # Optional if long_description is written in rst but required for - # plain-text or Markdown; if unspecified, "applications should attempt to - # render [the long_description] as text/x-rst; charset=UTF-8 and fall back - # to text/plain if it is not valid rst" (see link below) + # Optional if long_description is written in reStructuredText (rst) but + # required for plain-text or Markdown; if unspecified, "applications should + # attempt to render [the long_description] as text/x-rst; charset=UTF-8 and + # fall back to text/plain if it is not valid rst" (see link below) # # This field corresponds to the "Description-Content-Type" metadata field: # https://packaging.python.org/specifications/core-metadata/#description-content-type-optional - long_description_content_type='text/markdown', # Optional + long_description_content_type='text/markdown', # Optional (see note above) # This should be a valid link to your project's main homepage. # From 6013c4539465f911a5e6e5247fb1771d0b56f70b Mon Sep 17 00:00:00 2001 From: Yeray Diaz Diaz Date: Sun, 8 Apr 2018 10:04:20 +0100 Subject: [PATCH 19/83] Fix README links --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 03c8eca1..7a871399 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,9 @@ usage examples, etc. Generally, including the project changelog in here is not a good idea, although a simple “What's New” section for the most recent version may be appropriate. -[packaging guide]: https://twitter.com/mcclure111/status/975031304742895616 -[distribution tutorial]: https://twitter.com/mcclure111/status/975031304742895616 -[src]: https://twitter.com/mcclure111/status/975031304742895616 -[rst]: https://twitter.com/mcclure111/status/975031304742895616 +[packaging guide]: https://packaging.python.org +[distribution tutorial]: https://packaging.python.org/en/latest/distributing.html +[src]: https://github.com/pypa/sampleproject +[rst]: http://docutils.sourceforge.net/rst.html [md]: https://tools.ietf.org/html/rfc7764#section-3.5 "CommonMark variant" [md use]: https://packaging.python.org/specifications/core-metadata/#description-content-type-optional From 1fd9d2ad4dc8c99d8d492740eaf3f1ce8ba9daa5 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Wed, 25 Apr 2018 18:23:45 -0500 Subject: [PATCH 20/83] Fix check command in CI There is no need to use the `-r` (`--restructuredtext`) flag with `python setup.py check` anymore, as the description is now Markdown --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b3f7fa58..2f04e187 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ deps = pytest commands = check-manifest --ignore tox.ini,tests* - python setup.py check -m -r -s + python setup.py check -m -s flake8 . py.test tests [flake8] From 2623b15d212cb59da1c3965d5e35c78103d3a1a7 Mon Sep 17 00:00:00 2001 From: Greg Back Date: Wed, 25 Apr 2018 17:30:57 -0500 Subject: [PATCH 21/83] Update link to Classifer list. --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 312248b7..1848ba87 100644 --- a/setup.py +++ b/setup.py @@ -85,8 +85,7 @@ # Classifiers help users find your project by categorizing it. # - # For a list of valid classifiers, see - # https://pypi.python.org/pypi?%3Aaction=list_classifiers + # For a list of valid classifiers, see https://pypi.org/classifiers/ classifiers=[ # Optional # How mature is this project? Common values are # 3 - Alpha From 9ae2387da0dfa6cbe649f69aa8225d7ec305d478 Mon Sep 17 00:00:00 2001 From: Robert Bricheno Date: Thu, 26 Apr 2018 18:03:35 +0100 Subject: [PATCH 22/83] More information about the 'universal' flag. When I first encountered the original comment I found it a bit vague because I didn't really know about wheels. I knew that the package I wanted to make wouldn't work on Python 2 so I didn't want to make a universal wheel. But I had to research how this line needed to be changed to do what I wanted, and ended up reading the bdist_wheel.py source to find the answer, which seems excessively difficult. These changes hopefully make it more obvious what to do in my situation. --- setup.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 75e201ac..f015063e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,5 +6,8 @@ license_file = LICENSE.txt # This flag says to generate wheels that support both Python 2 and Python # 3. If your code will not run unchanged on both Python 2 and 3, you will # need to generate separate wheels for each Python version that you -# support. +# support. Setting the value of 'universal' to anything other than '1', +# 'true' or 'yes' (case insensitive) or removing this line will prevent +# bdist_wheel from trying to make a universal wheel. For more see: +# https://packaging.python.org/tutorials/distributing-packages/#wheels universal=1 From 704a4b4d29976161ce35bf8bcf2898f8994b6783 Mon Sep 17 00:00:00 2001 From: Robert Bricheno Date: Fri, 27 Apr 2018 12:32:30 +0100 Subject: [PATCH 23/83] Removed confusing minutiae --- setup.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index f015063e..5f9fe9b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,8 +6,7 @@ license_file = LICENSE.txt # This flag says to generate wheels that support both Python 2 and Python # 3. If your code will not run unchanged on both Python 2 and 3, you will # need to generate separate wheels for each Python version that you -# support. Setting the value of 'universal' to anything other than '1', -# 'true' or 'yes' (case insensitive) or removing this line will prevent +# support. Removing this line (or setting universal to 0) will prevent # bdist_wheel from trying to make a universal wheel. For more see: # https://packaging.python.org/tutorials/distributing-packages/#wheels universal=1 From ce10821e1391613d14a44a06a07b3d00c18cccf5 Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Wed, 6 Jun 2018 01:12:09 +1000 Subject: [PATCH 24/83] Handle Windows line endings correctly in setup.py codecs.open doesn't implement universal newlines handling, which causes metadata parsing problems if the `README` file uses Windows line endings. Switching to io.open instead gives the Python 3 open() semantics (the main reason to prefer codecs.open() instead was for Python 2.5 support, which is no longer a concern) Prompted by https://github.com/pypa/packaging-problems/issues/160 --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1848ba87..9cf357f2 100644 --- a/setup.py +++ b/setup.py @@ -7,9 +7,12 @@ # Always prefer setuptools over distutils from setuptools import setup, find_packages -# To use a consistent encoding -from codecs import open from os import path +# io.open is needed for projects that support Python 2.7 +# It ensures open() defaults to text mode with universal newlines, +# and accepts an argument to specify the text encoding +# Python 3 only projects can skip this import +from io import open here = path.abspath(path.dirname(__file__)) From e36874514bfd1e900a52b8419aaade075d8ec5cc Mon Sep 17 00:00:00 2001 From: Greg Back Date: Mon, 2 Jul 2018 10:03:47 -0500 Subject: [PATCH 25/83] Clarify usage of readme_renderer in tox.ini When the sampleproject README was converted from .rst to .md, some of the explanatory text was no longer valid. See 1fd9d2ad4dc8c99d8d492740eaf3f1ce8ba9daa5. --- tox.ini | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 2f04e187..73f431c7 100644 --- a/tox.ini +++ b/tox.ini @@ -5,8 +5,10 @@ # # - check-manifest # confirm items checked into vcs are in your sdist -# - python setup.py check (using the readme_renderer extension) -# confirms your long_description will render correctly on pypi +# - python setup.py check +# confirm required package meta-data in setup.py +# - readme_renderer (when using a ReStructuredText README) +# confirms your long_description will render correctly on PyPI. # # and also to help confirm pull requests to this project. @@ -21,11 +23,15 @@ basepython = py36: python3.6 deps = check-manifest - readme_renderer + # If your project uses README.rst, uncomment the following: + # readme_renderer flake8 pytest commands = check-manifest --ignore tox.ini,tests* + # This repository uses a Markdown long_description, so the -r flag to + # `setup.py check` is not needed. If your project contains a README.rst, + # use `python setup.py check -m -r -s` instead. python setup.py check -m -s flake8 . py.test tests From 08acfdefe82227942e268debe41d2787380d6740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=84=B1=EB=B2=94=20=28Bang=20Seongbeom=29?= Date: Tue, 28 Aug 2018 21:58:10 +0900 Subject: [PATCH 26/83] Make description optional `description` keyword corresponds to "Summary" metadata field. "Summary" is not a required field as described below: https://packaging.python.org/specifications/core-metadata/ > `Metadata-Version` > `Name` > `Version` > All the other fields are optional. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9cf357f2..67556c65 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: # https://packaging.python.org/specifications/core-metadata/#summary - description='A sample Python project', # Required + description='A sample Python project', # Optional # This is an optional longer description of your project that represents # the body of text which users will see when they visit PyPI. From de62417d626413a7a3d2630e228d48f37aee0227 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Sat, 15 Sep 2018 20:47:56 +0000 Subject: [PATCH 27/83] Fix link to PyPUG section on building wheels --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 5f9fe9b5..0a5b77b5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,5 +8,5 @@ license_file = LICENSE.txt # need to generate separate wheels for each Python version that you # support. Removing this line (or setting universal to 0) will prevent # bdist_wheel from trying to make a universal wheel. For more see: -# https://packaging.python.org/tutorials/distributing-packages/#wheels +# https://packaging.python.org/guides/distributing-packages-using-setuptools/#wheels universal=1 From 9be24e3a5686e48b60ec3ad90de7eee3c113c4e4 Mon Sep 17 00:00:00 2001 From: Ester Ramos Date: Sat, 27 Oct 2018 11:01:33 +0100 Subject: [PATCH 28/83] Add Python37 support to setup.py and tox.ini --- setup.py | 1 + tox.ini | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 67556c65..d5533eb0 100644 --- a/setup.py +++ b/setup.py @@ -111,6 +111,7 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', ], # This field adds keywords for your project which will appear on the diff --git a/tox.ini b/tox.ini index 73f431c7..454d7fb3 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{27,34,35,36} +envlist = py{27,34,35,36,37} [testenv] basepython = @@ -21,9 +21,10 @@ basepython = py34: python3.4 py35: python3.5 py36: python3.6 + py37: python3.7 deps = check-manifest - # If your project uses README.rst, uncomment the following: + # If your project uses README.rst, uncomment the following: # readme_renderer flake8 pytest From 5064c6292be293dd4df7ef1eb94826300fc38124 Mon Sep 17 00:00:00 2001 From: Rui Date: Wed, 14 Nov 2018 14:57:25 -0300 Subject: [PATCH 29/83] Update setup.cfg Fixes #85 Replaces deprecated "license_file" with the more versatile "license_files". https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file --- setup.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0a5b77b5..2aee262e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,7 @@ [metadata] -# This includes the license file in the wheel. -license_file = LICENSE.txt +# This includes the license(s) file(s) in the wheel. +# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file +license_files = LICENSE.txt [bdist_wheel] # This flag says to generate wheels that support both Python 2 and Python From 5f80d7e37f611c4acd4f62fd1778d7b0d225fc18 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Wed, 14 Nov 2018 17:02:36 -0300 Subject: [PATCH 30/83] Update setup.cfg Accept suggestion. Co-Authored-By: rnetonet --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 2aee262e..bb3303f8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [metadata] -# This includes the license(s) file(s) in the wheel. +# This includes the license file(s) in the wheel. # https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file license_files = LICENSE.txt From a5c864d0f5c19397b12420329abf8f25260403ca Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Wed, 30 Jan 2019 11:10:52 +0100 Subject: [PATCH 31/83] Demonstrate python_requires usage Closes #53 --- setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup.py b/setup.py index d5533eb0..b87c85d5 100644 --- a/setup.py +++ b/setup.py @@ -105,6 +105,8 @@ # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. + # These classifiers are *not* checked by 'pip install'. See instead + # 'python_requires' below. 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', @@ -131,6 +133,13 @@ # packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required + # Specify which Python versions you support. In contrast to the 'Programming + # Language' classifiers above, 'pip install' will check this and refuse to + # install the project if the version does not match. If you support Python 2 + # or have more complicated version requirements, see + # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires + python_requires='>=3.5', + # This field lists other packages that your project depends on to run. # Any package you put here will be installed by pip when your project is # installed, so they must be valid existing projects. From 8be4b6be00f8fd18350df2dbf00e63672a7a5867 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Wed, 30 Jan 2019 20:35:20 +0100 Subject: [PATCH 32/83] Show how to allow both Python 2 and 3 in python_requires --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index b87c85d5..3611857d 100644 --- a/setup.py +++ b/setup.py @@ -135,10 +135,10 @@ # Specify which Python versions you support. In contrast to the 'Programming # Language' classifiers above, 'pip install' will check this and refuse to - # install the project if the version does not match. If you support Python 2 - # or have more complicated version requirements, see + # install the project if the version does not match. If you do not support + # Python 2, you can simplify this to '>=3.5' or similar, see # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - python_requires='>=3.5', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4', # This field lists other packages that your project depends on to run. # Any package you put here will be installed by pip when your project is From 16ad666c6053a4fe45d5a6871f35176d7cea84e6 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Wed, 30 Jan 2019 20:44:53 +0100 Subject: [PATCH 33/83] Reformat to make flake8 happy --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 3611857d..ea655a82 100644 --- a/setup.py +++ b/setup.py @@ -133,10 +133,10 @@ # packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required - # Specify which Python versions you support. In contrast to the 'Programming - # Language' classifiers above, 'pip install' will check this and refuse to - # install the project if the version does not match. If you do not support - # Python 2, you can simplify this to '>=3.5' or similar, see + # Specify which Python versions you support. In contrast to the + # 'Programming Language' classifiers above, 'pip install' will check this + # and refuse to install the project if the version does not match. If you + # do not support Python 2, you can simplify this to '>=3.5' or similar, see # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4', From 0b40cea8264f38aa545818b0e2716597a678d1b6 Mon Sep 17 00:00:00 2001 From: Parker Higgins Date: Sat, 2 Mar 2019 19:44:15 -0500 Subject: [PATCH 34/83] fixes broken link to packaging/distribution tutorial --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a871399..0a02d387 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ good idea, although a simple “What's New” section for the most recent versio may be appropriate. [packaging guide]: https://packaging.python.org -[distribution tutorial]: https://packaging.python.org/en/latest/distributing.html +[distribution tutorial]: https://packaging.python.org/tutorials/packaging-projects/ [src]: https://github.com/pypa/sampleproject [rst]: http://docutils.sourceforge.net/rst.html [md]: https://tools.ietf.org/html/rfc7764#section-3.5 "CommonMark variant" From 63e13c737d85bbe503e603376fd3e03422d0c51e Mon Sep 17 00:00:00 2001 From: Malware Utkonos Date: Tue, 26 Mar 2019 16:27:47 -0400 Subject: [PATCH 35/83] Update Packaging documentation link The old link leads to a 404. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ea655a82..011ea904 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ """A setuptools based setup module. See: -https://packaging.python.org/en/latest/distributing.html +https://packaging.python.org/guides/distributing-packages-using-setuptools/ https://github.com/pypa/sampleproject """ From cbabca3f3f54a6e053e231d4cc89a46550049107 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 28 May 2019 15:21:54 -0500 Subject: [PATCH 36/83] Version 1.3.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 011ea904..8ca69755 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ # For a discussion on single-sourcing the version across setup.py and the # project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.2.0', # Required + version='1.3.0', # Required # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: From 388156a01d3ca549b25fdfbf6108072790d30b0a Mon Sep 17 00:00:00 2001 From: Makdon Date: Sat, 27 Jul 2019 19:38:49 +0800 Subject: [PATCH 37/83] Update setup.py to remove python 3.4 python 3.4 came to it's EOL so i remove it for setup.py --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8ca69755..fdb9202f 100644 --- a/setup.py +++ b/setup.py @@ -110,7 +110,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', @@ -138,7 +137,7 @@ # and refuse to install the project if the version does not match. If you # do not support Python 2, you can simplify this to '>=3.5' or similar, see # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4', # This field lists other packages that your project depends on to run. # Any package you put here will be installed by pip when your project is From 25efbf3314423de8e12de244931600a360a14930 Mon Sep 17 00:00:00 2001 From: Makdon Date: Sat, 27 Jul 2019 20:39:40 +0800 Subject: [PATCH 38/83] Update .travis.yml for removing python 3.4 --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ec1a266..6d87ac3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,6 @@ matrix: include: - python: 2.7 env: TOXENV=py27 - - python: 3.4 - env: TOXENV=py34 - python: 3.5 env: TOXENV=py35 - python: 3.6 From 924aeab7a97079fc064d20953f1792e20debf233 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Sat, 27 Jul 2019 11:07:16 -0400 Subject: [PATCH 39/83] Remove Python 3.4 from tox.ini --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 454d7fb3..b0c54ad3 100644 --- a/tox.ini +++ b/tox.ini @@ -13,12 +13,11 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{27,34,35,36,37} +envlist = py{27,35,36,37} [testenv] basepython = py27: python2.7 - py34: python3.4 py35: python3.5 py36: python3.6 py37: python3.7 From 8dc7f310fde89ce5def8bff5cb89fb7a4e8887b5 Mon Sep 17 00:00:00 2001 From: Albert Tugushev Date: Tue, 24 Sep 2019 00:53:37 +0300 Subject: [PATCH 40/83] Use tox-travis to simplify configuration --- .travis.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6d87ac3e..f450cd73 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,16 +3,12 @@ language: python -matrix: - include: - - python: 2.7 - env: TOXENV=py27 - - python: 3.5 - env: TOXENV=py35 - - python: 3.6 - env: TOXENV=py36 +python: + - "2.7" + - "3.5" + - "3.6" -install: pip install tox +install: pip install tox-travis script: tox From f958fa8d7fb939cd999599c83b0f1a60b2777183 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 4 Nov 2019 14:27:55 -0600 Subject: [PATCH 41/83] Remove extra whitespace --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index b0c54ad3..46f3195f 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ # # - check-manifest # confirm items checked into vcs are in your sdist -# - python setup.py check +# - python setup.py check # confirm required package meta-data in setup.py # - readme_renderer (when using a ReStructuredText README) # confirms your long_description will render correctly on PyPI. From f89336e88d2f5d70c0fa4e40e44a7fabbf3c917a Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 4 Nov 2019 14:28:16 -0600 Subject: [PATCH 42/83] Add Python 3.8 classifier --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index fdb9202f..8cff668c 100644 --- a/setup.py +++ b/setup.py @@ -113,6 +113,7 @@ 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', ], # This field adds keywords for your project which will appear on the From 1f08cd3f0ef99a58cccc5303707b2665925bb13b Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 4 Nov 2019 14:28:48 -0600 Subject: [PATCH 43/83] Add Python 3.8 support --- .travis.yml | 4 ++++ tox.ini | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6d87ac3e..be652cea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,10 @@ matrix: env: TOXENV=py35 - python: 3.6 env: TOXENV=py36 + - python: 3.7 + env: TOXENV=py37 + - python: 3.8 + env: TOXENV=py38 install: pip install tox diff --git a/tox.ini b/tox.ini index 46f3195f..68165ea2 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{27,35,36,37} +envlist = py{27,35,36,37,38} [testenv] basepython = @@ -21,6 +21,7 @@ basepython = py35: python3.5 py36: python3.6 py37: python3.7 + py38: python3.8 deps = check-manifest # If your project uses README.rst, uncomment the following: From cecab2119a195c5e6c732e13379e0e52a676fba8 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Mon, 4 Nov 2019 14:29:17 -0600 Subject: [PATCH 44/83] Bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8cff668c..3cf26d1e 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ # For a discussion on single-sourcing the version across setup.py and the # project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.3.0', # Required + version='1.3.1', # Required # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: From 56d3120cc2a1727c00aad9418e6612abbbd55830 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Sat, 16 Nov 2019 14:53:58 -0600 Subject: [PATCH 45/83] Switch over to using the src/ layout Per the discussions at the PyPA packaging mini-summit at PyCon US 2019, we decided to switch over to the safer src/ layout. --- setup.py | 6 +++++- {sample => src/sample}/__init__.py | 0 {sample => src/sample}/package_data.dat | 0 3 files changed, 5 insertions(+), 1 deletion(-) rename {sample => src/sample}/__init__.py (100%) rename {sample => src/sample}/package_data.dat (100%) diff --git a/setup.py b/setup.py index 3cf26d1e..a9960a82 100644 --- a/setup.py +++ b/setup.py @@ -122,6 +122,10 @@ # Note that this is a string of words separated by whitespace, not a list. keywords='sample setuptools development', # Optional + # When your source code is in a subdirectory under the project root, e.g. + # `src/`, it is necessary to specify the `package_dir` argument. + package_dir={'': 'src'}, # Optional + # You can just specify package directories manually here if your project is # simple. Or you can use find_packages(). # @@ -131,7 +135,7 @@ # # py_modules=["my_module"], # - packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required + packages=find_packages(where='src'), # Required # Specify which Python versions you support. In contrast to the # 'Programming Language' classifiers above, 'pip install' will check this diff --git a/sample/__init__.py b/src/sample/__init__.py similarity index 100% rename from sample/__init__.py rename to src/sample/__init__.py diff --git a/sample/package_data.dat b/src/sample/package_data.dat similarity index 100% rename from sample/package_data.dat rename to src/sample/package_data.dat From 83148c568c09179ed93ef9fccd1574549c69749f Mon Sep 17 00:00:00 2001 From: David Tucker Date: Sun, 17 Nov 2019 14:05:39 -0800 Subject: [PATCH 46/83] Remove basepython for default tox environments --- tox.ini | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 68165ea2..a89fc656 100644 --- a/tox.ini +++ b/tox.ini @@ -16,12 +16,6 @@ envlist = py{27,35,36,37,38} [testenv] -basepython = - py27: python2.7 - py35: python3.5 - py36: python3.6 - py37: python3.7 - py38: python3.8 deps = check-manifest # If your project uses README.rst, uncomment the following: @@ -36,6 +30,7 @@ commands = python setup.py check -m -s flake8 . py.test tests + [flake8] exclude = .tox,*.egg,build,data select = E,W,F From 3e7dc62cf240dc4f4fea8974e18169b042606843 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Mon, 14 Oct 2019 11:13:19 -0700 Subject: [PATCH 47/83] Implement PEP 518 and opt into PEP 517 builds --- MANIFEST.in | 2 ++ pyproject.toml | 5 +++++ tox.ini | 11 +++++++++++ 3 files changed, 18 insertions(+) create mode 100644 pyproject.toml diff --git a/MANIFEST.in b/MANIFEST.in index c066bbd4..ca3d4484 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,5 @@ +include pyproject.toml + # Include the README include *.md diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..6ddb34b8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +# These are the assumed default build requirements from pip: +# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support +requires = ["setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/tox.ini b/tox.ini index a89fc656..9bfe638c 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,17 @@ [tox] envlist = py{27,35,36,37,38} +# Define the minimal tox version required to run; +# if the host tox is less than this the tool with create an environment and +# provision it with a tox that satisfies it under provision_tox_env. +# At least this version is needed for PEP 517/518 support. +minversion = 3.3.0 + +# Activate isolated build environment. tox will use a virtual environment +# to build a source distribution from the source tree. For build tools and +# arguments use the pyproject.toml file as specified in PEP-517 and PEP-518. +isolated_build = true + [testenv] deps = check-manifest From e07596dfeff00a7beae1b8c75312d639357fee94 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Tue, 3 Dec 2019 16:01:35 -0600 Subject: [PATCH 48/83] Pass positional arguments to pytest --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 9bfe638c..9a7ab006 100644 --- a/tox.ini +++ b/tox.ini @@ -40,7 +40,7 @@ commands = # use `python setup.py check -m -r -s` instead. python setup.py check -m -s flake8 . - py.test tests + py.test tests {posargs} [flake8] exclude = .tox,*.egg,build,data From 04b2941484ab9ce9f38ef3edd3a9143eeaf07931 Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Mon, 4 May 2020 22:08:18 +0300 Subject: [PATCH 49/83] Update check-manifest invocation check-manifest 0.42 updated `--ignore` handling to be more consistent with MANIFEST.in global-exclude directives. As a result, `tests*` no longer matches files inside a `tests` directory, and you have to use `tests/**` instead. As an extra complication, check-manifest drops Python 2.7 support. Since you still have py27 in this tox.ini, this means you get an older check-manifest 0.41, and you have to tell it to ignore the empty `tests` directory that remains after you exclude all the files in it. For details see the second half of https://github.com/mgedmin/check-manifest/issues/98 I apologize for the inconvenience! --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 9a7ab006..0c0368a9 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ deps = flake8 pytest commands = - check-manifest --ignore tox.ini,tests* + check-manifest --ignore 'tox.ini,tests,tests/**' # This repository uses a Markdown long_description, so the -r flag to # `setup.py check` is not needed. If your project contains a README.rst, # use `python setup.py check -m -r -s` instead. From 428f6c0659b542cd4bc218132b50184eb5c2587a Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 4 May 2020 23:03:06 +0300 Subject: [PATCH 50/83] Drop support for EOL Python 2 --- .travis.yml | 1 - setup.cfg | 9 --------- setup.py | 23 ++++++----------------- src/sample/__init__.py | 1 - tox.ini | 2 +- 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 451c9382..e583fcca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ language: python python: - - "2.7" - "3.5" - "3.6" - "3.7" diff --git a/setup.cfg b/setup.cfg index bb3303f8..dadae668 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,12 +2,3 @@ # This includes the license file(s) in the wheel. # https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file license_files = LICENSE.txt - -[bdist_wheel] -# This flag says to generate wheels that support both Python 2 and Python -# 3. If your code will not run unchanged on both Python 2 and 3, you will -# need to generate separate wheels for each Python version that you -# support. Removing this line (or setting universal to 0) will prevent -# bdist_wheel from trying to make a universal wheel. For more see: -# https://packaging.python.org/guides/distributing-packages-using-setuptools/#wheels -universal=1 diff --git a/setup.py b/setup.py index a9960a82..ec01b5b1 100644 --- a/setup.py +++ b/setup.py @@ -8,11 +8,6 @@ # Always prefer setuptools over distutils from setuptools import setup, find_packages from os import path -# io.open is needed for projects that support Python 2.7 -# It ensures open() defaults to text mode with universal newlines, -# and accepts an argument to specify the text encoding -# Python 3 only projects can skip this import -from io import open here = path.abspath(path.dirname(__file__)) @@ -104,16 +99,14 @@ 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - # These classifiers are *not* checked by 'pip install'. See instead - # 'python_requires' below. - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', + # that you indicate you support Python 3. These classifiers are *not* + # checked by 'pip install'. See instead 'python_requires' below. 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3 :: Only', ], # This field adds keywords for your project which will appear on the @@ -139,10 +132,9 @@ # Specify which Python versions you support. In contrast to the # 'Programming Language' classifiers above, 'pip install' will check this - # and refuse to install the project if the version does not match. If you - # do not support Python 2, you can simplify this to '>=3.5' or similar, see + # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4', + python_requires='>=3.5, <4', # This field lists other packages that your project depends on to run. # Any package you put here will be installed by pip when your project is @@ -167,16 +159,13 @@ # If there are data files included in your packages that need to be # installed, specify them here. - # - # If using Python 2.6 or earlier, then these have to be included in - # MANIFEST.in as well. package_data={ # Optional 'sample': ['package_data.dat'], }, # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: - # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files + # http://docs.python.org/distutils/setupscript.html#installing-additional-files # # In this case, 'data_file' will be installed into '/my_data' data_files=[('my_data', ['data/data_file'])], # Optional diff --git a/src/sample/__init__.py b/src/sample/__init__.py index db836cee..c8f10649 100644 --- a/src/sample/__init__.py +++ b/src/sample/__init__.py @@ -1,4 +1,3 @@ - def main(): """Entry point for the application script""" print("Call your main application code here") diff --git a/tox.ini b/tox.ini index 0c0368a9..d05589ac 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{27,35,36,37,38} +envlist = py{35,36,37,38} # Define the minimal tox version required to run; # if the host tox is less than this the tool with create an environment and From a4117c85bee2ae52b05a8aa74247d5a9739748fd Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 5 May 2020 10:44:36 +0300 Subject: [PATCH 51/83] Simplify check-manifest call with v0.42 --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index d05589ac..4e48a185 100644 --- a/tox.ini +++ b/tox.ini @@ -28,13 +28,13 @@ isolated_build = true [testenv] deps = - check-manifest + check-manifest >= 0.42 # If your project uses README.rst, uncomment the following: # readme_renderer flake8 pytest commands = - check-manifest --ignore 'tox.ini,tests,tests/**' + check-manifest --ignore 'tox.ini,tests/**' # This repository uses a Markdown long_description, so the -r flag to # `setup.py check` is not needed. If your project contains a README.rst, # use `python setup.py check -m -r -s` instead. From b10dec0f0585c305dde9d053eb38de07bf0d11a2 Mon Sep 17 00:00:00 2001 From: Sumana Harihareswara Date: Thu, 28 May 2020 16:57:37 -0400 Subject: [PATCH 52/83] Update sample author email Per https://groups.google.com/d/msg/pypa-dev/rUNsfIbruHM/LCEx-CB5AgAJ the pypa-dev Google Group is now decommissioned. Taking this opportunity to make the sample author email address more sensical. Signed-off-by: Sumana Harihareswara --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8b41ed7a..25d9d613 100644 --- a/setup.py +++ b/setup.py @@ -65,11 +65,11 @@ # This should be your name or the name of the organization which owns the # project. - author='The Python Packaging Authority', # Optional + author='A. Random Developer', # Optional # This should be a valid email address corresponding to the author listed # above. - author_email='pypa-dev@googlegroups.com', # Optional + author_email='author@example.com', # Optional # Classifiers help users find your project by categorizing it. # From 851b5f0beccc7037af611beb962a49d34af58a8a Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Sat, 13 Jun 2020 16:52:10 -0400 Subject: [PATCH 53/83] 64 Added python logo image to README.md inline --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0a02d387..79f9d267 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # A sample Python project +![alt text](https://www.python.org/static/img/python-logo.png "Sample inline image") + A sample project that exists as an aid to the [Python Packaging User Guide][packaging guide]'s [Tutorial on Packaging and Distributing Projects][distribution tutorial]. From 77db8e659eb38fc6507589f010d57c35e9e63ee2 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Sun, 14 Jun 2020 11:10:11 -0400 Subject: [PATCH 54/83] 119 updated python logo --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 79f9d267..636fc69c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,13 @@ # A sample Python project -![alt text](https://www.python.org/static/img/python-logo.png "Sample inline image") +![Python Logo](https://www.python.org/static/community_logos/python-logo.png "Sample inline image") + + +![license][license] +![last commit][last_commit] + +![tweet me][twitter_shield] +![discord server][discord_server] A sample project that exists as an aid to the [Python Packaging User Guide][packaging guide]'s [Tutorial on Packaging and Distributing @@ -35,5 +42,9 @@ may be appropriate. [distribution tutorial]: https://packaging.python.org/tutorials/packaging-projects/ [src]: https://github.com/pypa/sampleproject [rst]: http://docutils.sourceforge.net/rst.html -[md]: https://tools.ietf.org/html/rfc7764#section-3.5 "CommonMark variant" [md use]: https://packaging.python.org/specifications/core-metadata/#description-content-type-optional + +[twitter_shield]: https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2FSaltyCatFish +[license]: https://img.shields.io/badge/license-MIT-brightgreen +[last_commit]: https://img.shields.io/github/last-commit/saltycatfish/sampleproject +[discord_server]: https://img.shields.io/discord/314944764648620033 \ No newline at end of file From 0ceff90ee5d3dea7c305848d941bfeae9bfbfee9 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Sun, 14 Jun 2020 11:13:38 -0400 Subject: [PATCH 55/83] 119 updated python logo (removed some other code from my own fork) --- README.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/README.md b/README.md index 636fc69c..256f305b 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,6 @@ ![Python Logo](https://www.python.org/static/community_logos/python-logo.png "Sample inline image") - -![license][license] -![last commit][last_commit] - -![tweet me][twitter_shield] -![discord server][discord_server] - A sample project that exists as an aid to the [Python Packaging User Guide][packaging guide]'s [Tutorial on Packaging and Distributing Projects][distribution tutorial]. @@ -42,9 +35,5 @@ may be appropriate. [distribution tutorial]: https://packaging.python.org/tutorials/packaging-projects/ [src]: https://github.com/pypa/sampleproject [rst]: http://docutils.sourceforge.net/rst.html +[md]: https://tools.ietf.org/html/rfc7764#section-3.5 "CommonMark variant" [md use]: https://packaging.python.org/specifications/core-metadata/#description-content-type-optional - -[twitter_shield]: https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Ftwitter.com%2FSaltyCatFish -[license]: https://img.shields.io/badge/license-MIT-brightgreen -[last_commit]: https://img.shields.io/github/last-commit/saltycatfish/sampleproject -[discord_server]: https://img.shields.io/discord/314944764648620033 \ No newline at end of file From c7a4cfb287b680e3b63977fd6ed9d461a100d0f6 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Sun, 14 Jun 2020 11:38:04 -0400 Subject: [PATCH 56/83] 26 added simple module and test module --- src/sample/simple.py | 14 ++++++++++++++ tests/test_simple.py | 14 ++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/sample/simple.py diff --git a/src/sample/simple.py b/src/sample/simple.py new file mode 100644 index 00000000..a98686e7 --- /dev/null +++ b/src/sample/simple.py @@ -0,0 +1,14 @@ +def add_one(number): + """Adds one to number + + Args: + number (int/float): + + Returns: + number + + Raises + """ + return number + 1 + + diff --git a/tests/test_simple.py b/tests/test_simple.py index 61e44ebc..b7a0ee3a 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -2,6 +2,16 @@ # testing in general, but rather to support the `find_packages` example in # setup.py that excludes installing the "tests" package +import unittest -def test_success(): - assert True +from sample.simple import add_one + + +class TestSimple(unittest.TestCase): + + def test_add_one(self): + self.assertEqual(add_one(5), 6) + + +if __name__ == '__main__': + unittest.main() From 00bed2f909a40aee9a7b3d2a13dd37f8054d3928 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Sun, 14 Jun 2020 11:39:27 -0400 Subject: [PATCH 57/83] Removed google style rst to remain agnostic --- src/sample/simple.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/sample/simple.py b/src/sample/simple.py index a98686e7..51094591 100644 --- a/src/sample/simple.py +++ b/src/sample/simple.py @@ -1,14 +1,4 @@ def add_one(number): - """Adds one to number - - Args: - number (int/float): - - Returns: - number - - Raises - """ return number + 1 From c54b977c7ebf379f957db1cf7ce776608c67a521 Mon Sep 17 00:00:00 2001 From: Ryan Long Date: Sun, 14 Jun 2020 11:52:12 -0400 Subject: [PATCH 58/83] Removed blank lines --- src/sample/simple.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/sample/simple.py b/src/sample/simple.py index 51094591..c929f885 100644 --- a/src/sample/simple.py +++ b/src/sample/simple.py @@ -1,4 +1,2 @@ def add_one(number): return number + 1 - - From 87a7ae8fbe3ac5e2c6a66f2a45e44e398f1ea54e Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Thu, 25 Jun 2020 13:47:56 -0500 Subject: [PATCH 59/83] Add release automation --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..dd645e13 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to +# help make automated releases for this project + +name: Release + +on: + push: + branches: + - master + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: '3.x' + - name: Install build dependencies + run: pip install -U setuptools wheel build + - name: Build + run: python -m build . + - name: Publish + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.pypi_password }} From 3b0207a3396b634e41af20e82e0c710194d5f5dd Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Thu, 25 Jun 2020 14:08:53 -0500 Subject: [PATCH 60/83] Version 2.0.0 (#125) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index defeb300..e2adf6a3 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ # For a discussion on single-sourcing the version across setup.py and the # project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='1.3.1', # Required + version='2.0.0', # Required # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: From 45225b8095590e6f03790dd77ccb92671bc3c788 Mon Sep 17 00:00:00 2001 From: RedBit Date: Thu, 25 Jun 2020 15:18:54 -0400 Subject: [PATCH 61/83] 106 add commas to keywords in setup.py (#120) * 106 add commas to keywords in setup.py * Changed language in setup.py to match change to resolve #106 * Split lines to stay under limit. #106 * Changed language to match example in https://github.com/pypa/packaging.python.org/pull/674/ . #106 * Typo fix. #106 --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e2adf6a3..6c715861 100644 --- a/setup.py +++ b/setup.py @@ -112,8 +112,10 @@ # This field adds keywords for your project which will appear on the # project page. What does your project relate to? # - # Note that this is a string of words separated by whitespace, not a list. - keywords='sample setuptools development', # Optional + # Note that this is a list of additional keywords, separated + # by commas, to be used to assist searching for the distribution in a + # larger catalog. + keywords='sample, setuptools, development', # Optional # When your source code is in a subdirectory under the project root, e.g. # `src/`, it is necessary to specify the `package_dir` argument. From 5db250e8abe6e9bb43924eb2ce10c46322044f8e Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Thu, 25 Jun 2020 14:19:14 -0500 Subject: [PATCH 62/83] Don't fail when releasing an existing version (#126) --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd645e13..4fdab128 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,3 +25,4 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.pypi_password }} + skip_existing: true From 52966defd6a61e97295b0bb82cd3474ac3e11c7a Mon Sep 17 00:00:00 2001 From: Julin S <48789920+ju-sh@users.noreply.github.com> Date: Tue, 30 Jun 2020 18:46:55 +0530 Subject: [PATCH 63/83] use pathlib (#128) --- setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 6c715861..c1bf5014 100644 --- a/setup.py +++ b/setup.py @@ -7,13 +7,12 @@ # Always prefer setuptools over distutils from setuptools import setup, find_packages -from os import path +import pathlib -here = path.abspath(path.dirname(__file__)) +here = pathlib.Path(__file__).parent.resolve() # Get the long description from the README file -with open(path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = f.read() +long_description = (here / 'README.md').read_text(encoding='utf-8') # Arguments marked as "Required" below must be included for upload to PyPI. # Fields marked as "Optional" may be commented out. From 90d44abe361688aba5a189e661423863b34f5208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Lipt=C3=A1k?= Date: Thu, 7 Jan 2021 22:30:10 -0500 Subject: [PATCH 64/83] Remove Python 3.5 and add 3.9 (#132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gábor Lipták --- .travis.yml | 2 +- MANIFEST.in | 3 +++ setup.py | 4 ++-- tox.ini | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e583fcca..bf25dc5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,10 @@ language: python python: - - "3.5" - "3.6" - "3.7" - "3.8" + - "3.9" install: pip install tox-travis diff --git a/MANIFEST.in b/MANIFEST.in index ca3d4484..0f9746aa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,5 +6,8 @@ include *.md # Include the license file include LICENSE.txt +# Include setup.py +include setup.py + # Include the data files recursive-include data * diff --git a/setup.py b/setup.py index c1bf5014..ab0eadf8 100644 --- a/setup.py +++ b/setup.py @@ -101,10 +101,10 @@ # that you indicate you support Python 3. These classifiers are *not* # checked by 'pip install'. See instead 'python_requires' below. 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3 :: Only', ], @@ -135,7 +135,7 @@ # 'Programming Language' classifiers above, 'pip install' will check this # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - python_requires='>=3.5, <4', + python_requires='>=3.6, <4', # This field lists other packages that your project depends on to run. # Any package you put here will be installed by pip when your project is diff --git a/tox.ini b/tox.ini index 4e48a185..a200849b 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{35,36,37,38} +envlist = py{36,37,38,39} # Define the minimal tox version required to run; # if the host tox is less than this the tool with create an environment and From d2bae02873f8dc964b07b27176efc751f2e58860 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Sat, 30 Oct 2021 14:34:38 -0400 Subject: [PATCH 65/83] GitHub Actions (#153) * Slight tweaks to the release workflow * Add testing workflow * Support Python 3.10 * Remove Travis-CI config --- .github/workflows/release.yml | 5 +++-- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ .travis.yml | 17 ----------------- setup.py | 1 + tox.ini | 2 +- 5 files changed, 30 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4fdab128..56338dbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,13 +12,14 @@ jobs: build-and-publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 with: python-version: '3.x' - name: Install build dependencies - run: pip install -U setuptools wheel build + run: python -m pip install -U setuptools wheel build - name: Build run: python -m build . - name: Publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..6f48433d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to +# help test this project + +name: Test + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + python: ['3.6', '3.7', '3.8', '3.9', '3.10'] + platform: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install test dependencies + run: python -m pip install -U tox + - name: Test + run: python -m tox -e py diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bf25dc5c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# this file is *not* meant to cover or endorse the use of travis, but rather to -# help confirm pull requests to this project. - -language: python - -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" - -install: pip install tox-travis - -script: tox - -notifications: - email: false diff --git a/setup.py b/setup.py index ab0eadf8..5955265f 100644 --- a/setup.py +++ b/setup.py @@ -105,6 +105,7 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + "Programming Language :: Python :: 3.10", 'Programming Language :: Python :: 3 :: Only', ], diff --git a/tox.ini b/tox.ini index a200849b..5e7832c6 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{36,37,38,39} +envlist = py{36,37,38,39,310} # Define the minimal tox version required to run; # if the host tox is less than this the tool with create an environment and From 091d322233d7993214272f469f9b27ec6d9b6cfc Mon Sep 17 00:00:00 2001 From: Guillaume Latour Date: Sat, 30 Oct 2021 20:55:21 +0200 Subject: [PATCH 66/83] dead link: requirements.txt vs install_requires (#147) Co-authored-by: Dustin Ingram --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5955265f..fa5096c6 100644 --- a/setup.py +++ b/setup.py @@ -143,7 +143,7 @@ # installed, so they must be valid existing projects. # # For an analysis of "install_requires" vs pip's requirements files see: - # https://packaging.python.org/en/latest/requirements.html + # https://packaging.python.org/discussions/install-requires-vs-requirements install_requires=['peppercorn'], # Optional # List additional groups of dependencies here (e.g. development From 3a836905fbd687af334db16b16c37cf51dcbc99c Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Sat, 30 Oct 2021 22:22:07 +0200 Subject: [PATCH 67/83] Fix some dead links (#148) Co-authored-by: Dustin Ingram --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index fa5096c6..6b3ee7a2 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ # # For a discussion on single-sourcing the version across setup.py and the # project code, see - # https://packaging.python.org/en/latest/single_source_version.html + # https://packaging.python.org/guides/single-sourcing-package-version/ version='2.0.0', # Required # This is a one-line description or tagline of what your project does. This @@ -143,7 +143,7 @@ # installed, so they must be valid existing projects. # # For an analysis of "install_requires" vs pip's requirements files see: - # https://packaging.python.org/discussions/install-requires-vs-requirements + # https://packaging.python.org/discussions/install-requires-vs-requirements/ install_requires=['peppercorn'], # Optional # List additional groups of dependencies here (e.g. development From 87c524aec9586b92932dc261923dc8686dcfa019 Mon Sep 17 00:00:00 2001 From: Diego Ramirez Date: Tue, 23 Nov 2021 06:34:58 -0600 Subject: [PATCH 68/83] Remove MANIFEST.in entirely (#155) * Upgrade the Setuptools version That way, we can remove items from the manifest file. * Simplify the manifest file Remove: * pyproject.toml (now covered by setuptools>=43.0.0) * LICENSE.txt (included by `license_files` and covered by setuptools>=42.0.0) * setup.py (which is the file where the build is called) * Remove README.md from the manifest file It is now included by default. * Delete MANIFEST.in This is no longer necessary. All the items are included by Setuptools. --- MANIFEST.in | 13 ------------- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 0f9746aa..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,13 +0,0 @@ -include pyproject.toml - -# Include the README -include *.md - -# Include the license file -include LICENSE.txt - -# Include setup.py -include setup.py - -# Include the data files -recursive-include data * diff --git a/pyproject.toml b/pyproject.toml index 6ddb34b8..9ebf2060 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] # These are the assumed default build requirements from pip: # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support -requires = ["setuptools>=40.8.0", "wheel"] +requires = ["setuptools>=43.0.0", "wheel"] build-backend = "setuptools.build_meta" From d424e4310bda95f5ae8cfdf1de583a973680cf88 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 12 Mar 2022 00:48:54 +0100 Subject: [PATCH 69/83] Upgrade actions/checkout and setup-python (#162) --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f48433d..a1be5c09 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,9 +14,9 @@ jobs: runs-on: ${{ matrix.platform }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} - name: Install test dependencies From 918bd331501de42be32666bd5140d04d00b39386 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Thu, 24 Mar 2022 18:23:18 -0400 Subject: [PATCH 70/83] Drop support for Python 3.6 (#165) --- .github/workflows/test.yml | 2 +- setup.py | 86 ++++++++++++++------------------------ tox.ini | 2 +- 3 files changed, 34 insertions(+), 56 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1be5c09..4e3efde4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: test: strategy: matrix: - python: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python: ['3.7', '3.8', '3.9', '3.10'] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/setup.py b/setup.py index 6b3ee7a2..217a8b21 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ here = pathlib.Path(__file__).parent.resolve() # Get the long description from the README file -long_description = (here / 'README.md').read_text(encoding='utf-8') +long_description = (here / "README.md").read_text(encoding="utf-8") # Arguments marked as "Required" below must be included for upload to PyPI. # Fields marked as "Optional" may be commented out. @@ -29,21 +29,18 @@ # There are some restrictions on what makes a valid project name # specification here: # https://packaging.python.org/specifications/core-metadata/#name - name='sampleproject', # Required - + name="sampleproject", # Required # Versions should comply with PEP 440: # https://www.python.org/dev/peps/pep-0440/ # # For a discussion on single-sourcing the version across setup.py and the # project code, see # https://packaging.python.org/guides/single-sourcing-package-version/ - version='2.0.0', # Required - + version="2.0.0", # Required # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: # https://packaging.python.org/specifications/core-metadata/#summary - description='A sample Python project', # Optional - + description="A sample Python project", # Optional # This is an optional longer description of your project that represents # the body of text which users will see when they visit PyPI. # @@ -53,7 +50,6 @@ # This field corresponds to the "Description" metadata field: # https://packaging.python.org/specifications/core-metadata/#description-optional long_description=long_description, # Optional - # Denotes that our long_description is in Markdown; valid values are # text/plain, text/x-rst, and text/markdown # @@ -64,22 +60,18 @@ # # This field corresponds to the "Description-Content-Type" metadata field: # https://packaging.python.org/specifications/core-metadata/#description-content-type-optional - long_description_content_type='text/markdown', # Optional (see note above) - + long_description_content_type="text/markdown", # Optional (see note above) # This should be a valid link to your project's main homepage. # # This field corresponds to the "Home-Page" metadata field: # https://packaging.python.org/specifications/core-metadata/#home-page-optional - url='https://github.com/pypa/sampleproject', # Optional - + url="https://github.com/pypa/sampleproject", # Optional # This should be your name or the name of the organization which owns the # project. - author='A. Random Developer', # Optional - + author="A. Random Developer", # Optional # This should be a valid email address corresponding to the author listed # above. - author_email='author@example.com', # Optional - + author_email="author@example.com", # Optional # Classifiers help users find your project by categorizing it. # # For a list of valid classifiers, see https://pypi.org/classifiers/ @@ -88,39 +80,32 @@ # 3 - Alpha # 4 - Beta # 5 - Production/Stable - 'Development Status :: 3 - Alpha', - + "Development Status :: 3 - Alpha", # Indicate who your project is intended for - 'Intended Audience :: Developers', - 'Topic :: Software Development :: Build Tools', - + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", # Pick your license as you wish - 'License :: OSI Approved :: MIT License', - + "License :: OSI Approved :: MIT License", # Specify the Python versions you support here. In particular, ensure # that you indicate you support Python 3. These classifiers are *not* # checked by 'pip install'. See instead 'python_requires' below. - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - 'Programming Language :: Python :: 3 :: Only', + "Programming Language :: Python :: 3 :: Only", ], - # This field adds keywords for your project which will appear on the # project page. What does your project relate to? # # Note that this is a list of additional keywords, separated # by commas, to be used to assist searching for the distribution in a # larger catalog. - keywords='sample, setuptools, development', # Optional - + keywords="sample, setuptools, development", # Optional # When your source code is in a subdirectory under the project root, e.g. # `src/`, it is necessary to specify the `package_dir` argument. - package_dir={'': 'src'}, # Optional - + package_dir={"": "src"}, # Optional # You can just specify package directories manually here if your project is # simple. Or you can use find_packages(). # @@ -130,22 +115,19 @@ # # py_modules=["my_module"], # - packages=find_packages(where='src'), # Required - + packages=find_packages(where="src"), # Required # Specify which Python versions you support. In contrast to the # 'Programming Language' classifiers above, 'pip install' will check this # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - python_requires='>=3.6, <4', - + python_requires=">=3.7, <4", # This field lists other packages that your project depends on to run. # Any package you put here will be installed by pip when your project is # installed, so they must be valid existing projects. # # For an analysis of "install_requires" vs pip's requirements files see: # https://packaging.python.org/discussions/install-requires-vs-requirements/ - install_requires=['peppercorn'], # Optional - + install_requires=["peppercorn"], # Optional # List additional groups of dependencies here (e.g. development # dependencies). Users will be able to install these using the "extras" # syntax, for example: @@ -155,23 +137,20 @@ # Similar to `install_requires` above, these must be valid existing # projects. extras_require={ # Optional - 'dev': ['check-manifest'], - 'test': ['coverage'], + "dev": ["check-manifest"], + "test": ["coverage"], }, - # If there are data files included in your packages that need to be # installed, specify them here. package_data={ # Optional - 'sample': ['package_data.dat'], + "sample": ["package_data.dat"], }, - # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: # http://docs.python.org/distutils/setupscript.html#installing-additional-files # # In this case, 'data_file' will be installed into '/my_data' - data_files=[('my_data', ['data/data_file'])], # Optional - + data_files=[("my_data", ["data/data_file"])], # Optional # To provide executable scripts, use entry points in preference to the # "scripts" keyword. Entry points provide cross-platform support and allow # `pip` to create the appropriate form of executable for the target @@ -180,11 +159,10 @@ # For example, the following would provide a command called `sample` which # executes the function `main` from this package when invoked: entry_points={ # Optional - 'console_scripts': [ - 'sample=sample:main', + "console_scripts": [ + "sample=sample:main", ], }, - # List additional URLs that are relevant to your project as a dict. # # This field corresponds to the "Project-URL" metadata fields: @@ -195,9 +173,9 @@ # maintainers, and where to support the project financially. The key is # what's used to render the link text on PyPI. project_urls={ # Optional - 'Bug Reports': 'https://github.com/pypa/sampleproject/issues', - 'Funding': 'https://donate.pypi.org', - 'Say Thanks!': 'http://saythanks.io/to/example', - 'Source': 'https://github.com/pypa/sampleproject/', + "Bug Reports": "https://github.com/pypa/sampleproject/issues", + "Funding": "https://donate.pypi.org", + "Say Thanks!": "http://saythanks.io/to/example", + "Source": "https://github.com/pypa/sampleproject/", }, ) diff --git a/tox.ini b/tox.ini index 5e7832c6..ab06581f 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{36,37,38,39,310} +envlist = py{37,38,39,310} # Define the minimal tox version required to run; # if the host tox is less than this the tool with create an environment and From d4ee05fdc03e848ed6e7065d8fe8e833a3c8c0b2 Mon Sep 17 00:00:00 2001 From: Mizux Date: Mon, 19 Sep 2022 18:17:17 +0200 Subject: [PATCH 71/83] Update release.yml (#175) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56338dbe..fda4b413 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ name: Release on: push: branches: - - master + - main jobs: build-and-publish: From db5806e0a3204034c51b1c00dde7d5eb3fa2532e Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Thu, 1 Dec 2022 16:53:46 +0000 Subject: [PATCH 72/83] Remove mention of deprecated setuptools features (#181) --- data/data_file | 1 - setup.py | 13 +------------ tox.ini | 6 ------ 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 data/data_file diff --git a/data/data_file b/data/data_file deleted file mode 100644 index 7c0646bf..00000000 --- a/data/data_file +++ /dev/null @@ -1 +0,0 @@ -some data \ No newline at end of file diff --git a/setup.py b/setup.py index 217a8b21..6d76ec40 100644 --- a/setup.py +++ b/setup.py @@ -145,18 +145,7 @@ package_data={ # Optional "sample": ["package_data.dat"], }, - # Although 'package_data' is the preferred approach, in some case you may - # need to place data files outside of your packages. See: - # http://docs.python.org/distutils/setupscript.html#installing-additional-files - # - # In this case, 'data_file' will be installed into '/my_data' - data_files=[("my_data", ["data/data_file"])], # Optional - # To provide executable scripts, use entry points in preference to the - # "scripts" keyword. Entry points provide cross-platform support and allow - # `pip` to create the appropriate form of executable for the target - # platform. - # - # For example, the following would provide a command called `sample` which + # Entry points. The following would provide a command called `sample` which # executes the function `main` from this package when invoked: entry_points={ # Optional "console_scripts": [ diff --git a/tox.ini b/tox.ini index ab06581f..1acece95 100644 --- a/tox.ini +++ b/tox.ini @@ -5,8 +5,6 @@ # # - check-manifest # confirm items checked into vcs are in your sdist -# - python setup.py check -# confirm required package meta-data in setup.py # - readme_renderer (when using a ReStructuredText README) # confirms your long_description will render correctly on PyPI. # @@ -35,10 +33,6 @@ deps = pytest commands = check-manifest --ignore 'tox.ini,tests/**' - # This repository uses a Markdown long_description, so the -r flag to - # `setup.py check` is not needed. If your project contains a README.rst, - # use `python setup.py check -m -r -s` instead. - python setup.py check -m -s flake8 . py.test tests {posargs} From aeeb50a948addcb712ad4261df472263514991e1 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Thu, 1 Dec 2022 13:49:54 -0500 Subject: [PATCH 73/83] Move to metadata to `pyproject.toml` (#166) --- README.md | 2 +- pyproject.toml | 149 ++++++++++++++++++++++++++++++++++++++++ setup.cfg | 4 -- setup.py | 170 ---------------------------------------------- tests/__init__.py | 5 +- tox.ini | 4 ++ 6 files changed, 156 insertions(+), 178 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/README.md b/README.md index 256f305b..d6c10ebb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ recommendations for version control, documentation, or testing. [The source for this project is available here][src]. -Most of the configuration for a Python project is done in the `setup.py` file, +The metadata for a Python project is defined in the `pyproject.toml` file, an example of which is included in this project. You should edit this file accordingly to adapt this sample project to your needs. diff --git a/pyproject.toml b/pyproject.toml index 9ebf2060..dfab9897 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,152 @@ +[project] +# This is the name of your project. The first time you publish this +# package, this name will be registered for you. It will determine how +# users can install this project, e.g.: +# +# $ pip install sampleproject +# +# And where it will live on PyPI: https://pypi.org/project/sampleproject/ +# +# There are some restrictions on what makes a valid project name +# specification here: +# https://packaging.python.org/specifications/core-metadata/#name +name = "sampleproject" # Required + +# Versions should comply with PEP 440: +# https://www.python.org/dev/peps/pep-0440/ +# +# For a discussion on single-sourcing the version, see +# https://packaging.python.org/guides/single-sourcing-package-version/ +version = "3.0.0" # Required + +# This is a one-line description or tagline of what your project does. This +# corresponds to the "Summary" metadata field: +# https://packaging.python.org/specifications/core-metadata/#summary +description = "A sample Python project" # Optional + +# This is an optional longer description of your project that represents +# the body of text which users will see when they visit PyPI. +# +# Often, this is the same as your README, so you can just read it in from +# that file directly (as we have already done above) +# +# This field corresponds to the "Description" metadata field: +# https://packaging.python.org/specifications/core-metadata/#description-optional +readme = "README.md" # Optional + +# Specify which Python versions you support. In contrast to the +# 'Programming Language' classifiers above, 'pip install' will check this +# and refuse to install the project if the version does not match. See +# https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires +requires-python = ">=3.7" + +# This is either text indicating the license for the distribution, or a file +# that contains the license +# https://packaging.python.org/en/latest/specifications/core-metadata/#license +license = {file = "LICENSE.txt"} + +# This field adds keywords for your project which will appear on the +# project page. What does your project relate to? +# +# Note that this is a list of additional keywords, separated +# by commas, to be used to assist searching for the distribution in a +# larger catalog. +keywords = ["sample", "setuptools", "development"] # Optional + +# This should be your name or the name of the organization who originally +# authored the project, and a valid email address corresponding to the name +# listed. +authors = [ + {name = "A. Random Developer", email = "author@example.com" } # Optional +] + +# This should be your name or the names of the organization who currently +# maintains the project, and a valid email address corresponding to the name +# listed. +maintainers = [ + {name = "A. Great Maintainer", email = "maintainer@example.com" } # Optional +] + +# Classifiers help users find your project by categorizing it. +# +# For a list of valid classifiers, see https://pypi.org/classifiers/ +classifiers = [ # Optional + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + "Development Status :: 3 - Alpha", + + # Indicate who your project is intended for + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + + # Pick your license as you wish + "License :: OSI Approved :: MIT License", + + # Specify the Python versions you support here. In particular, ensure + # that you indicate you support Python 3. These classifiers are *not* + # checked by "pip install". See instead "python_requires" below. + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3 :: Only", +] + +# This field lists other packages that your project depends on to run. +# Any package you put here will be installed by pip when your project is +# installed, so they must be valid existing projects. +# +# For an analysis of this field vs pip's requirements files see: +# https://packaging.python.org/discussions/install-requires-vs-requirements/ +dependencies = [ # Optional + "peppercorn" +] + +# List additional groups of dependencies here (e.g. development +# dependencies). Users will be able to install these using the "extras" +# syntax, for example: +# +# $ pip install sampleproject[dev] +# +# Similar to `dependencies` above, these must be valid existing +# projects. +[project.optional-dependencies] # Optional +dev = ["check-manifest"] +test = ["coverage"] + +# List URLs that are relevant to your project +# +# This field corresponds to the "Project-URL" and "Home-Page" metadata fields: +# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use +# https://packaging.python.org/specifications/core-metadata/#home-page-optional +# +# Examples listed include a pattern for specifying where the package tracks +# issues, where the source is hosted, where to say thanks to the package +# maintainers, and where to support the project financially. The key is +# what's used to render the link text on PyPI. +[project.urls] # Optional +"Homepage" = "https://github.com/pypa/sampleproject" +"Bug Reports" = "https://github.com/pypa/sampleproject/issues" +"Funding" = "https://donate.pypi.org" +"Say Thanks!" = "http://saythanks.io/to/example" +"Source" = "https://github.com/pypa/sampleproject/" + +# The following would provide a command line executable called `sample` +# which executes the function `main` from this package when invoked. +[project.scripts] # Optional +sample = "sample:main" + +# This is configuration specific to the `setuptools` build backend. +# If you are using a different build backend, you will need to change this. +[tool.setuptools] +# If there are data files included in your packages that need to be +# installed, specify them here. +package-data = {"sample" = ["*.dat"]} + [build-system] # These are the assumed default build requirements from pip: # https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index dadae668..00000000 --- a/setup.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[metadata] -# This includes the license file(s) in the wheel. -# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file -license_files = LICENSE.txt diff --git a/setup.py b/setup.py deleted file mode 100644 index 6d76ec40..00000000 --- a/setup.py +++ /dev/null @@ -1,170 +0,0 @@ -"""A setuptools based setup module. - -See: -https://packaging.python.org/guides/distributing-packages-using-setuptools/ -https://github.com/pypa/sampleproject -""" - -# Always prefer setuptools over distutils -from setuptools import setup, find_packages -import pathlib - -here = pathlib.Path(__file__).parent.resolve() - -# Get the long description from the README file -long_description = (here / "README.md").read_text(encoding="utf-8") - -# Arguments marked as "Required" below must be included for upload to PyPI. -# Fields marked as "Optional" may be commented out. - -setup( - # This is the name of your project. The first time you publish this - # package, this name will be registered for you. It will determine how - # users can install this project, e.g.: - # - # $ pip install sampleproject - # - # And where it will live on PyPI: https://pypi.org/project/sampleproject/ - # - # There are some restrictions on what makes a valid project name - # specification here: - # https://packaging.python.org/specifications/core-metadata/#name - name="sampleproject", # Required - # Versions should comply with PEP 440: - # https://www.python.org/dev/peps/pep-0440/ - # - # For a discussion on single-sourcing the version across setup.py and the - # project code, see - # https://packaging.python.org/guides/single-sourcing-package-version/ - version="2.0.0", # Required - # This is a one-line description or tagline of what your project does. This - # corresponds to the "Summary" metadata field: - # https://packaging.python.org/specifications/core-metadata/#summary - description="A sample Python project", # Optional - # This is an optional longer description of your project that represents - # the body of text which users will see when they visit PyPI. - # - # Often, this is the same as your README, so you can just read it in from - # that file directly (as we have already done above) - # - # This field corresponds to the "Description" metadata field: - # https://packaging.python.org/specifications/core-metadata/#description-optional - long_description=long_description, # Optional - # Denotes that our long_description is in Markdown; valid values are - # text/plain, text/x-rst, and text/markdown - # - # Optional if long_description is written in reStructuredText (rst) but - # required for plain-text or Markdown; if unspecified, "applications should - # attempt to render [the long_description] as text/x-rst; charset=UTF-8 and - # fall back to text/plain if it is not valid rst" (see link below) - # - # This field corresponds to the "Description-Content-Type" metadata field: - # https://packaging.python.org/specifications/core-metadata/#description-content-type-optional - long_description_content_type="text/markdown", # Optional (see note above) - # This should be a valid link to your project's main homepage. - # - # This field corresponds to the "Home-Page" metadata field: - # https://packaging.python.org/specifications/core-metadata/#home-page-optional - url="https://github.com/pypa/sampleproject", # Optional - # This should be your name or the name of the organization which owns the - # project. - author="A. Random Developer", # Optional - # This should be a valid email address corresponding to the author listed - # above. - author_email="author@example.com", # Optional - # Classifiers help users find your project by categorizing it. - # - # For a list of valid classifiers, see https://pypi.org/classifiers/ - classifiers=[ # Optional - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - "Development Status :: 3 - Alpha", - # Indicate who your project is intended for - "Intended Audience :: Developers", - "Topic :: Software Development :: Build Tools", - # Pick your license as you wish - "License :: OSI Approved :: MIT License", - # Specify the Python versions you support here. In particular, ensure - # that you indicate you support Python 3. These classifiers are *not* - # checked by 'pip install'. See instead 'python_requires' below. - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3 :: Only", - ], - # This field adds keywords for your project which will appear on the - # project page. What does your project relate to? - # - # Note that this is a list of additional keywords, separated - # by commas, to be used to assist searching for the distribution in a - # larger catalog. - keywords="sample, setuptools, development", # Optional - # When your source code is in a subdirectory under the project root, e.g. - # `src/`, it is necessary to specify the `package_dir` argument. - package_dir={"": "src"}, # Optional - # You can just specify package directories manually here if your project is - # simple. Or you can use find_packages(). - # - # Alternatively, if you just want to distribute a single Python file, use - # the `py_modules` argument instead as follows, which will expect a file - # called `my_module.py` to exist: - # - # py_modules=["my_module"], - # - packages=find_packages(where="src"), # Required - # Specify which Python versions you support. In contrast to the - # 'Programming Language' classifiers above, 'pip install' will check this - # and refuse to install the project if the version does not match. See - # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - python_requires=">=3.7, <4", - # This field lists other packages that your project depends on to run. - # Any package you put here will be installed by pip when your project is - # installed, so they must be valid existing projects. - # - # For an analysis of "install_requires" vs pip's requirements files see: - # https://packaging.python.org/discussions/install-requires-vs-requirements/ - install_requires=["peppercorn"], # Optional - # List additional groups of dependencies here (e.g. development - # dependencies). Users will be able to install these using the "extras" - # syntax, for example: - # - # $ pip install sampleproject[dev] - # - # Similar to `install_requires` above, these must be valid existing - # projects. - extras_require={ # Optional - "dev": ["check-manifest"], - "test": ["coverage"], - }, - # If there are data files included in your packages that need to be - # installed, specify them here. - package_data={ # Optional - "sample": ["package_data.dat"], - }, - # Entry points. The following would provide a command called `sample` which - # executes the function `main` from this package when invoked: - entry_points={ # Optional - "console_scripts": [ - "sample=sample:main", - ], - }, - # List additional URLs that are relevant to your project as a dict. - # - # This field corresponds to the "Project-URL" metadata fields: - # https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use - # - # Examples listed include a pattern for specifying where the package tracks - # issues, where the source is hosted, where to say thanks to the package - # maintainers, and where to support the project financially. The key is - # what's used to render the link text on PyPI. - project_urls={ # Optional - "Bug Reports": "https://github.com/pypa/sampleproject/issues", - "Funding": "https://donate.pypi.org", - "Say Thanks!": "http://saythanks.io/to/example", - "Source": "https://github.com/pypa/sampleproject/", - }, -) diff --git a/tests/__init__.py b/tests/__init__.py index 43d959a6..4eef093a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1,2 @@ -# the inclusion of the tests module is not meant to offer best practices for -# testing in general, but rather to support the `find_packages` example in -# setup.py that excludes installing the "tests" package +# The inclusion of the tests module is not meant to offer best practices for +# testing in general. diff --git a/tox.ini b/tox.ini index 1acece95..3816afd9 100644 --- a/tox.ini +++ b/tox.ini @@ -31,8 +31,12 @@ deps = # readme_renderer flake8 pytest + build + twine commands = check-manifest --ignore 'tox.ini,tests/**' + python -m build + python -m twine check dist/* flake8 . py.test tests {posargs} From fa13f7ddb228a2fea5f0175299aec5253ba3a3f9 Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Wed, 26 Apr 2023 00:08:50 +0200 Subject: [PATCH 74/83] Remove workflow warnings (#190) The warnings are: Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fda4b413..40dfcc5c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install build dependencies From fc8d83efd5749853507be959d858629d0aaf5c6e Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Wed, 26 Apr 2023 13:25:03 -0600 Subject: [PATCH 75/83] Update `release.yml` to use Trusted Publishing (#191) --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40dfcc5c..b95ba40e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,5 +25,4 @@ jobs: - name: Publish uses: pypa/gh-action-pypi-publish@master with: - password: ${{ secrets.pypi_password }} skip_existing: true From bae8ff4f61364453fd259eb505ea8ca99677b388 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Wed, 26 Jul 2023 16:45:17 -0400 Subject: [PATCH 76/83] Add token permissions to release workflow. (#192) Required for trusted publishing. --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b95ba40e..51d7c6b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,9 @@ on: jobs: build-and-publish: runs-on: ubuntu-latest + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write steps: - name: Checkout uses: actions/checkout@v3 From 3fb1461c7c13b6832ed0f25625b19f2d321a74b7 Mon Sep 17 00:00:00 2001 From: Dustin Ingram Date: Wed, 23 Aug 2023 09:46:23 -0400 Subject: [PATCH 77/83] Update `release.yml` with release branch for `gh-action-pypi-publish` (#195) * Update `release.yml` with release branch for `gh-action-pypi-publish` Per documentation here: https://github.com/pypa/gh-action-pypi-publish (cc @webknjaz) * Update .github/workflows/release.yml Co-authored-by: Sviatoslav Sydorenko --------- Co-authored-by: Sviatoslav Sydorenko --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 51d7c6b6..5bde2fcd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,6 @@ jobs: - name: Build run: python -m build . - name: Publish - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: - skip_existing: true + skip-existing: true From 9944026a711f5fc5e64a990542377439c58961ab Mon Sep 17 00:00:00 2001 From: Vladimir Fokow <57260995+VladimirFokow@users.noreply.github.com> Date: Thu, 29 Feb 2024 19:56:38 +0100 Subject: [PATCH 78/83] update python versions (#207) --- .github/workflows/test.yml | 2 +- pyproject.toml | 4 ++-- tox.ini | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e3efde4..67a77647 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: test: strategy: matrix: - python: ['3.7', '3.8', '3.9', '3.10'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/pyproject.toml b/pyproject.toml index dfab9897..f0624b7d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ readme = "README.md" # Optional # 'Programming Language' classifiers above, 'pip install' will check this # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires -requires-python = ">=3.7" +requires-python = ">=3.8" # This is either text indicating the license for the distribution, or a file # that contains the license @@ -88,11 +88,11 @@ classifiers = [ # Optional # that you indicate you support Python 3. These classifiers are *not* # checked by "pip install". See instead "python_requires" below. "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3 :: Only", ] diff --git a/tox.ini b/tox.ini index 3816afd9..c96f4e62 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{37,38,39,310} +envlist = py{38,39,310,311,312} # Define the minimal tox version required to run; # if the host tox is less than this the tool with create an environment and From b1dfa48c30459f28cc2ee51476c84d8874260b80 Mon Sep 17 00:00:00 2001 From: "Thomas B. Brunner" Date: Thu, 29 Feb 2024 20:07:10 +0100 Subject: [PATCH 79/83] Fixes inconsistencies in pyproject.toml documentation. (#197) * Minor improvements to pyproject.toml documentation. * Fixes readme field. --------- Co-authored-by: Dustin Ingram --- pyproject.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f0624b7d..90b02c2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,22 +28,22 @@ description = "A sample Python project" # Optional # the body of text which users will see when they visit PyPI. # # Often, this is the same as your README, so you can just read it in from -# that file directly (as we have already done above) +# that file directly. # # This field corresponds to the "Description" metadata field: # https://packaging.python.org/specifications/core-metadata/#description-optional readme = "README.md" # Optional # Specify which Python versions you support. In contrast to the -# 'Programming Language' classifiers above, 'pip install' will check this +# 'Programming Language' classifiers, 'pip install' will check this # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires -requires-python = ">=3.8" +requires-python = ">=3.8" # Optional # This is either text indicating the license for the distribution, or a file -# that contains the license +# that contains the license. # https://packaging.python.org/en/latest/specifications/core-metadata/#license -license = {file = "LICENSE.txt"} +license = {file = "LICENSE.txt"} # Optional # This field adds keywords for your project which will appear on the # project page. What does your project relate to? @@ -86,7 +86,7 @@ classifiers = [ # Optional # Specify the Python versions you support here. In particular, ensure # that you indicate you support Python 3. These classifiers are *not* - # checked by "pip install". See instead "python_requires" below. + # checked by "pip install". See instead "requires-python". "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", From 5d277956b5a571dac16b28db74e5f2b780d9af5f Mon Sep 17 00:00:00 2001 From: Vladimir Fokow <57260995+VladimirFokow@users.noreply.github.com> Date: Thu, 29 Feb 2024 21:58:10 +0100 Subject: [PATCH 80/83] Update pyproject.toml (#204) * Update pyproject.toml - extend descriptions of build-system table - add useful links - edit other comments * Update pyproject.toml - be more clear that the values in [build-system] may be generated by the command line interface of the build backend, so the [build-system] table is not required - reorganize comments to better correspond to their sections * add changes from #197 add the changes authored by thomasbbrunner in #197 * implement changes from code review - separate links to guide and specification - remove text that can already be found by following the provided links - more accurate comment about the `build-backend` key * minor: ":" * better comment about extras Co-authored-by: chrysle * remove # Optional coments, because instead of them we'll mark the REQUIRED fields --------- Co-authored-by: chrysle Co-authored-by: Dustin Ingram --- pyproject.toml | 60 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90b02c2c..caffcf03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,19 @@ +# Guide (user-friendly): +# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/ + +# Specification (technical, formal): +# https://packaging.python.org/en/latest/specifications/pyproject-toml/ + + +# Choosing a build backend: +# https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend +[build-system] +# A list of packages that are needed to build your package: +requires = ["setuptools"] # REQUIRED if [build-system] table is used +# The name of the Python object that frontends will use to perform the build: +build-backend = "setuptools.build_meta" # If not defined, then legacy behavior can happen. + + [project] # This is the name of your project. The first time you publish this # package, this name will be registered for you. It will determine how @@ -10,19 +26,19 @@ # There are some restrictions on what makes a valid project name # specification here: # https://packaging.python.org/specifications/core-metadata/#name -name = "sampleproject" # Required +name = "sampleproject" # REQUIRED, is the only field that cannot be marked as dynamic. # Versions should comply with PEP 440: # https://www.python.org/dev/peps/pep-0440/ # # For a discussion on single-sourcing the version, see # https://packaging.python.org/guides/single-sourcing-package-version/ -version = "3.0.0" # Required +version = "3.0.0" # REQUIRED, although can be dynamic # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: # https://packaging.python.org/specifications/core-metadata/#summary -description = "A sample Python project" # Optional +description = "A sample Python project" # This is an optional longer description of your project that represents # the body of text which users will see when they visit PyPI. @@ -32,18 +48,18 @@ description = "A sample Python project" # Optional # # This field corresponds to the "Description" metadata field: # https://packaging.python.org/specifications/core-metadata/#description-optional -readme = "README.md" # Optional +readme = "README.md" # Specify which Python versions you support. In contrast to the -# 'Programming Language' classifiers, 'pip install' will check this +# 'Programming Language' classifiers in this file, 'pip install' will check this # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires -requires-python = ">=3.8" # Optional +requires-python = ">=3.8" # This is either text indicating the license for the distribution, or a file # that contains the license. # https://packaging.python.org/en/latest/specifications/core-metadata/#license -license = {file = "LICENSE.txt"} # Optional +license = {file = "LICENSE.txt"} # This field adds keywords for your project which will appear on the # project page. What does your project relate to? @@ -51,26 +67,26 @@ license = {file = "LICENSE.txt"} # Optional # Note that this is a list of additional keywords, separated # by commas, to be used to assist searching for the distribution in a # larger catalog. -keywords = ["sample", "setuptools", "development"] # Optional +keywords = ["sample", "setuptools", "development"] # This should be your name or the name of the organization who originally # authored the project, and a valid email address corresponding to the name # listed. authors = [ - {name = "A. Random Developer", email = "author@example.com" } # Optional + {name = "A. Random Developer", email = "author@example.com" } ] # This should be your name or the names of the organization who currently # maintains the project, and a valid email address corresponding to the name # listed. maintainers = [ - {name = "A. Great Maintainer", email = "maintainer@example.com" } # Optional + {name = "A. Great Maintainer", email = "maintainer@example.com" } ] # Classifiers help users find your project by categorizing it. # # For a list of valid classifiers, see https://pypi.org/classifiers/ -classifiers = [ # Optional +classifiers = [ # How mature is this project? Common values are # 3 - Alpha # 4 - Beta @@ -86,7 +102,7 @@ classifiers = [ # Optional # Specify the Python versions you support here. In particular, ensure # that you indicate you support Python 3. These classifiers are *not* - # checked by "pip install". See instead "requires-python". + # checked by "pip install". See instead "requires-python" key in this file. "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", @@ -102,7 +118,7 @@ classifiers = [ # Optional # # For an analysis of this field vs pip's requirements files see: # https://packaging.python.org/discussions/install-requires-vs-requirements/ -dependencies = [ # Optional +dependencies = [ "peppercorn" ] @@ -112,9 +128,10 @@ dependencies = [ # Optional # # $ pip install sampleproject[dev] # -# Similar to `dependencies` above, these must be valid existing -# projects. -[project.optional-dependencies] # Optional +# Optional dependencies the project provides. These are commonly +# referred to as "extras". For a more extensive definition see: +# https://packaging.python.org/en/latest/specifications/dependency-specifiers/#extras +[project.optional-dependencies] dev = ["check-manifest"] test = ["coverage"] @@ -128,7 +145,7 @@ test = ["coverage"] # issues, where the source is hosted, where to say thanks to the package # maintainers, and where to support the project financially. The key is # what's used to render the link text on PyPI. -[project.urls] # Optional +[project.urls] "Homepage" = "https://github.com/pypa/sampleproject" "Bug Reports" = "https://github.com/pypa/sampleproject/issues" "Funding" = "https://donate.pypi.org" @@ -137,18 +154,13 @@ test = ["coverage"] # The following would provide a command line executable called `sample` # which executes the function `main` from this package when invoked. -[project.scripts] # Optional +[project.scripts] sample = "sample:main" + # This is configuration specific to the `setuptools` build backend. # If you are using a different build backend, you will need to change this. [tool.setuptools] # If there are data files included in your packages that need to be # installed, specify them here. package-data = {"sample" = ["*.dat"]} - -[build-system] -# These are the assumed default build requirements from pip: -# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support -requires = ["setuptools>=43.0.0", "wheel"] -build-backend = "setuptools.build_meta" From a1f00056ebc65d17ae69c5aba324ef4f0382138a Mon Sep 17 00:00:00 2001 From: chrysle <96722107+chrysle@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:20:11 +0200 Subject: [PATCH 81/83] Switch to `nox` for automated testing (#212) --- .github/workflows/test.yml | 6 +++-- .gitignore | 5 ++-- noxfile.py | 52 ++++++++++++++++++++++++++++++++++++++ tox.ini | 45 --------------------------------- 4 files changed, 59 insertions(+), 49 deletions(-) create mode 100644 noxfile.py delete mode 100644 tox.ini diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 67a77647..76651635 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,8 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install test dependencies - run: python -m pip install -U tox + run: python -m pip install --upgrade nox - name: Test - run: python -m tox -e py + run: python -m nox -s tests-${{ matrix.python }} + - name: Lint + run: python -m nox -s lint diff --git a/.gitignore b/.gitignore index e81f0842..ddc2bd11 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,8 @@ dist/ __pycache__/ *.so *~ +venv/ -# due to using tox and pytest -.tox +# due to using nox and pytest +.nox .cache diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 00000000..8d0c9495 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,52 @@ +# this file is *not* meant to cover or endorse the use of nox or pytest or +# testing in general, +# +# It's meant to show the use of: +# +# - check-manifest +# confirm items checked into vcs are in your sdist +# - readme_renderer (when using a reStructuredText README) +# confirms your long_description will render correctly on PyPI. +# +# and also to help confirm pull requests to this project. + +import nox +import os + +nox.options.sessions = ["lint"] + +# Define the minimal nox version required to run +nox.options.needs_version = ">= 2024.3.2" + + +@nox.session +def lint(session): + session.install("flake8") + session.run( + "flake8", "--exclude", ".nox,*.egg,build,data", + "--select", "E,W,F", "." + ) + + +@nox.session +def build_and_check_dists(session): + session.install("build", "check-manifest >= 0.42", "twine") + # If your project uses README.rst, uncomment the following: + # session.install("readme_renderer") + + session.run("check-manifest", "--ignore", "noxfile.py,tests/**") + session.run("python", "-m", "build") + session.run("python", "-m", "twine", "check", "dist/*") + + +@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"]) +def tests(session): + session.install("pytest") + build_and_check_dists(session) + + generated_files = os.listdir("dist/") + generated_sdist = os.path.join("dist/", generated_files[1]) + + session.install(generated_sdist) + + session.run("py.test", "tests/", *session.posargs) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index c96f4e62..00000000 --- a/tox.ini +++ /dev/null @@ -1,45 +0,0 @@ -# this file is *not* meant to cover or endorse the use of tox or pytest or -# testing in general, -# -# It's meant to show the use of: -# -# - check-manifest -# confirm items checked into vcs are in your sdist -# - readme_renderer (when using a ReStructuredText README) -# confirms your long_description will render correctly on PyPI. -# -# and also to help confirm pull requests to this project. - -[tox] -envlist = py{38,39,310,311,312} - -# Define the minimal tox version required to run; -# if the host tox is less than this the tool with create an environment and -# provision it with a tox that satisfies it under provision_tox_env. -# At least this version is needed for PEP 517/518 support. -minversion = 3.3.0 - -# Activate isolated build environment. tox will use a virtual environment -# to build a source distribution from the source tree. For build tools and -# arguments use the pyproject.toml file as specified in PEP-517 and PEP-518. -isolated_build = true - -[testenv] -deps = - check-manifest >= 0.42 - # If your project uses README.rst, uncomment the following: - # readme_renderer - flake8 - pytest - build - twine -commands = - check-manifest --ignore 'tox.ini,tests/**' - python -m build - python -m twine check dist/* - flake8 . - py.test tests {posargs} - -[flake8] -exclude = .tox,*.egg,build,data -select = E,W,F From 8603eaf898a2db2c89c36ad6b302f2994700ad6a Mon Sep 17 00:00:00 2001 From: Guy Hoozdis Date: Wed, 6 Nov 2024 16:08:20 -0600 Subject: [PATCH 82/83] Update workflow actions to remove warning messages (#214) --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 76651635..563126cd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,9 +14,9 @@ jobs: runs-on: ${{ matrix.platform }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - name: Install test dependencies From 621e4974ca25ce531773def586ba3ed8e736b3fc Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 6 Nov 2024 17:36:40 -0500 Subject: [PATCH 83/83] pyproject: prep 4.0.0 (#219) * pyproject: prep 4.0.0 Signed-off-by: William Woodruff * remove 3.8, add 3.13 Signed-off-by: William Woodruff * noxfile: remove 3.8, add 3.13 Signed-off-by: William Woodruff --------- Signed-off-by: William Woodruff --- .github/workflows/test.yml | 2 +- noxfile.py | 5 +++-- pyproject.toml | 28 ++++++++++++---------------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 563126cd..64d0c4ff 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: test: strategy: matrix: - python: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python: ['3.9', '3.10', '3.11', '3.12', '3.13'] platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: diff --git a/noxfile.py b/noxfile.py index 8d0c9495..d2ec8f70 100644 --- a/noxfile.py +++ b/noxfile.py @@ -10,9 +10,10 @@ # # and also to help confirm pull requests to this project. -import nox import os +import nox + nox.options.sessions = ["lint"] # Define the minimal nox version required to run @@ -39,7 +40,7 @@ def build_and_check_dists(session): session.run("python", "-m", "twine", "check", "dist/*") -@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"]) +@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"]) def tests(session): session.install("pytest") build_and_check_dists(session) diff --git a/pyproject.toml b/pyproject.toml index caffcf03..d97bdabb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,9 +9,9 @@ # https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend [build-system] # A list of packages that are needed to build your package: -requires = ["setuptools"] # REQUIRED if [build-system] table is used +requires = ["setuptools"] # REQUIRED if [build-system] table is used # The name of the Python object that frontends will use to perform the build: -build-backend = "setuptools.build_meta" # If not defined, then legacy behavior can happen. +build-backend = "setuptools.build_meta" # If not defined, then legacy behavior can happen. [project] @@ -26,14 +26,14 @@ build-backend = "setuptools.build_meta" # If not defined, then legacy behavior # There are some restrictions on what makes a valid project name # specification here: # https://packaging.python.org/specifications/core-metadata/#name -name = "sampleproject" # REQUIRED, is the only field that cannot be marked as dynamic. +name = "sampleproject" # REQUIRED, is the only field that cannot be marked as dynamic. # Versions should comply with PEP 440: # https://www.python.org/dev/peps/pep-0440/ # # For a discussion on single-sourcing the version, see # https://packaging.python.org/guides/single-sourcing-package-version/ -version = "3.0.0" # REQUIRED, although can be dynamic +version = "4.0.0" # REQUIRED, although can be dynamic # This is a one-line description or tagline of what your project does. This # corresponds to the "Summary" metadata field: @@ -54,12 +54,12 @@ readme = "README.md" # 'Programming Language' classifiers in this file, 'pip install' will check this # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires -requires-python = ">=3.8" +requires-python = ">=3.9" # This is either text indicating the license for the distribution, or a file # that contains the license. # https://packaging.python.org/en/latest/specifications/core-metadata/#license -license = {file = "LICENSE.txt"} +license = { file = "LICENSE.txt" } # This field adds keywords for your project which will appear on the # project page. What does your project relate to? @@ -72,15 +72,13 @@ keywords = ["sample", "setuptools", "development"] # This should be your name or the name of the organization who originally # authored the project, and a valid email address corresponding to the name # listed. -authors = [ - {name = "A. Random Developer", email = "author@example.com" } -] +authors = [{ name = "A. Random Developer", email = "author@example.com" }] # This should be your name or the names of the organization who currently # maintains the project, and a valid email address corresponding to the name # listed. maintainers = [ - {name = "A. Great Maintainer", email = "maintainer@example.com" } + { name = "A. Great Maintainer", email = "maintainer@example.com" }, ] # Classifiers help users find your project by categorizing it. @@ -104,11 +102,11 @@ classifiers = [ # that you indicate you support Python 3. These classifiers are *not* # checked by "pip install". See instead "requires-python" key in this file. "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", ] @@ -118,9 +116,7 @@ classifiers = [ # # For an analysis of this field vs pip's requirements files see: # https://packaging.python.org/discussions/install-requires-vs-requirements/ -dependencies = [ - "peppercorn" -] +dependencies = ["peppercorn"] # List additional groups of dependencies here (e.g. development # dependencies). Users will be able to install these using the "extras" @@ -128,7 +124,7 @@ dependencies = [ # # $ pip install sampleproject[dev] # -# Optional dependencies the project provides. These are commonly +# Optional dependencies the project provides. These are commonly # referred to as "extras". For a more extensive definition see: # https://packaging.python.org/en/latest/specifications/dependency-specifiers/#extras [project.optional-dependencies] @@ -163,4 +159,4 @@ sample = "sample:main" [tool.setuptools] # If there are data files included in your packages that need to be # installed, specify them here. -package-data = {"sample" = ["*.dat"]} +package-data = { "sample" = ["*.dat"] }