From db5fce2ee25b5ece417c12dddfc712beaace61fe Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Mon, 27 Dec 2021 23:16:19 +0530 Subject: [PATCH 1/2] Removed changes related to setuptools_scm --- .github/workflows/main.yml | 2 - pyproject.toml | 12 ------ setup.cfg | 77 +---------------------------------- setup.py | 83 ++++++++++++++++++++++++++++++++------ tox.ini | 25 ------------ 5 files changed, 71 insertions(+), 128 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12dce4e24..8fb12c2b4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,8 +24,6 @@ jobs: pip install tox virtualenv - name: Lint run: "tox -e lint" - - name: Packaging - run: "tox -e packaging" - name: Safety run: "tox -e safety" build: diff --git a/pyproject.toml b/pyproject.toml index 26bea3f21..2240e4443 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,5 @@ -[build-system] -requires = [ - "setuptools >= 42.0.0", # required by pyproject+setuptools_scm integration - "setuptools_scm[toml] >= 3.5.0", # required for "no-local-version" scheme - "setuptools_scm_git_archive >= 1.0", - "wheel", -] -build-backend = "setuptools.build_meta" - [tool.black] skip-string-normalization = true exclude = '/(tests/hooks-abort-render/hooks|docs\/HelloCookieCutter1)/' line-length = 88 target-version = ['py39'] - -[tool.setuptools_scm] -local_scheme = "no-local-version" diff --git a/setup.cfg b/setup.cfg index e1ddc4fbb..6d65158d3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,78 +1,3 @@ -[metadata] -name = cookiecutter -url = https://github.com/cookiecutter/cookiecutter -project_urls = - Bug Tracker = https://github.com/cookiecutter/cookiecutter/issues - CI: GitHub = https://github.com/cookiecutter/cookiecutter/actions - Documentation = https://cookiecutter.readthedocs.io/ - Source Code = https://github.com/cookiecutter/cookiecutter -description = - A command-line utility that creates projects from project - templates, e.g. creating a Python package project from a - Python package project template. -long_description = file: README.md -long_description_content_type = text/markdown -author = Audrey Roy Greenfeld -author_email = audreyr@gmail.com -maintainer = Audrey Roy Greenfeld -maintainer_email = audreyr@gmail.com -license = BSD -license_file = LICENSE -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Console - Intended Audience :: Developers - Natural Language :: English - License :: OSI Approved :: BSD License - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python - Topic :: Software Development -keywords = - cookiecutter - Python - projects - project templates - Jinja2 - skeleton - scaffolding - project directory - package - packaging - -[options] -use_scm_version = True -python_requires = >=3.6 -; package_dir = -; = src -packages = cookiecutter -zip_safe = False - -# These are required during `setup.py` run: -setup_requires = - setuptools_scm>=1.15.0 - setuptools_scm_git_archive>=1.0 - -install_requires = - binaryornot>=0.4.4 - Jinja2>=2.7,<4.0.0 - click>=7.0,<9.0.0 - pyyaml>=5.3.1 - jinja2-time>=0.2.0 - python-slugify>=4.0.0 - requests>=2.23.0 - -[options.entry_points] -console_scripts = - cookiecutter = cookiecutter.__main__:main - -[flake8] -ignore = BLK100,E231,W503 - # Excludes due to known issues or incompatibilities with black: # BLK100: Black would make changes. https://pypi.org/project/flake8-black/ # W503: https://github.com/psf/black/search?q=W503&unscoped_q=W503 @@ -83,7 +8,7 @@ statistics = 1 max-line-length = 88 [bdist_wheel] -universal = false +universal = 1 [tool:pytest] testpaths = tests diff --git a/setup.py b/setup.py index 5a2d616e8..c2db2f187 100644 --- a/setup.py +++ b/setup.py @@ -1,13 +1,70 @@ -#! /usr/bin/env python3 -"""cookiecutter distutils configuration. - -The presence of this file ensures the support -of pip editable mode *with setuptools only*. -""" -import setuptools - -# https://github.com/jazzband/pip-tools/issues/1278 -setuptools.setup( - use_scm_version={"local_scheme": "no-local-version"}, - setup_requires=["setuptools_scm[toml]>=3.5.0"], -) +#!/usr/bin/env python +"""cookiecutter distutils configuration.""" +from setuptools import setup + +version = "2.0.0" + +with open('README.md', encoding='utf-8') as readme_file: + readme = readme_file.read() + +requirements = [ + 'binaryornot>=0.4.4', + 'Jinja2>=2.7,<4.0.0', + 'click>=7.0,<8.0.0', + 'pyyaml>=5.3.1', + 'jinja2-time>=0.2.0', + 'python-slugify>=4.0.0', + 'requests>=2.23.0', +] + +setup( + name='cookiecutter', + version=version, + description=( + 'A command-line utility that creates projects from project ' + 'templates, e.g. creating a Python package project from a ' + 'Python package project template.' + ), + long_description=readme, + long_description_content_type='text/markdown', + author='Audrey Feldroy', + author_email='audreyr@gmail.com', + url='https://github.com/cookiecutter/cookiecutter', + packages=['cookiecutter'], + package_dir={'cookiecutter': 'cookiecutter'}, + entry_points={'console_scripts': ['cookiecutter = cookiecutter.__main__:main']}, + include_package_data=True, + python_requires='>=3.6', + install_requires=requirements, + license='BSD', + zip_safe=False, + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "Natural Language :: English", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 3 :: Only", + "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 :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Programming Language :: Python", + "Topic :: Software Development", + ], + keywords=[ + "cookiecutter", + "Python", + "projects", + "project templates", + "Jinja2", + "skeleton", + "scaffolding", + "project directory", + "package", + "packaging", + ], +) \ No newline at end of file diff --git a/tox.ini b/tox.ini index b8dd5c5e1..4cde29296 100644 --- a/tox.ini +++ b/tox.ini @@ -42,28 +42,3 @@ commands = safety check --full-report deps = safety - -[testenv:packaging] -description = - Build package, verify metadata, install package and assert behavior when ansible is missing. -deps = - build - twine -skip_install = true -commands = - {envpython} -c 'import os.path, shutil, sys; \ - dist_dir = os.path.join("{toxinidir}", "dist"); \ - os.path.isdir(dist_dir) or sys.exit(0); \ - print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \ - shutil.rmtree(dist_dir)' - # build using moder python build (PEP-517) - {envpython} -m build \ - --sdist \ - --wheel \ - --outdir {toxinidir}/dist/ \ - {toxinidir} - # Validate metadata using twine - twine check {toxinidir}/dist/* - # Install the wheel - sh -c "python3 -m pip install {toxinidir}/dist/*.whl" -whitelist_externals = sh From c578dce794956641b5f3baa86e804b0ccad1276f Mon Sep 17 00:00:00 2001 From: Prathamesh Desai Date: Mon, 27 Dec 2021 23:29:39 +0530 Subject: [PATCH 2/2] Fixed flake8 section in setup.cfg --- setup.cfg | 3 ++- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 6d65158d3..938b39de6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,8 +1,9 @@ +[flake8] # Excludes due to known issues or incompatibilities with black: # BLK100: Black would make changes. https://pypi.org/project/flake8-black/ # W503: https://github.com/psf/black/search?q=W503&unscoped_q=W503 # E231: https://github.com/psf/black/issues/1202 - +ignore = BLK100,E231,W503 statistics = 1 # black official is 88 max-line-length = 88 diff --git a/setup.py b/setup.py index c2db2f187..654010fa0 100644 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ install_requires=requirements, license='BSD', zip_safe=False, - classifiers=[ + classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", @@ -67,4 +67,4 @@ "package", "packaging", ], -) \ No newline at end of file +)