standardize project metadata
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent e666f7a · Browse files · 6 files·+68 added−281 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+68 added−281 removed
- other:+68 added−281 removed
Provenance
- Commit
24498af- Tree
3046f46- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
e666f7a
6 files changed+68 added−281 removed
deleted:scripts/make-release.py-164 removed
1-#!/usr/bin/env python2-from __future__ import print_function3-4-import os5-import re6-import sys7-from datetime import date, datetime8-from subprocess import PIPE, Popen9-10-_date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)')11-12-13-def parse_changelog():14- with open('CHANGES.rst') as f:15- lineiter = iter(f)16- for line in lineiter:17- match = re.search('^Version\s+(.*)', line.strip())18-19- if match is None:20- continue21-22- version = match.group(1).strip()23-24- if next(lineiter).count('-') != len(match.group(0)):25- continue26-27- while 1:28- change_info = next(lineiter).strip()29-30- if change_info:31- break32-33- match = re.search(34- r'released on (\w+\s+\d+\w+\s+\d+)(?:, codename (.*))?',35- change_info,36- flags=re.IGNORECASE37- )38-39- if match is None:40- continue41-42- datestr, codename = match.groups()43- return version, parse_date(datestr), codename44-45-46-def bump_version(version):47- try:48- parts = [int(i) for i in version.split('.')]49- except ValueError:50- fail('Current version is not numeric')51-52- parts[-1] += 153- return '.'.join(map(str, parts))54-55-56-def parse_date(string):57- string = _date_strip_re.sub('', string)58- return datetime.strptime(string, '%B %d %Y')59-60-61-def set_filename_version(filename, version_number, pattern):62- changed = []63-64- def inject_version(match):65- before, old, after = match.groups()66- changed.append(True)67- return before + version_number + after68-69- with open(filename) as f:70- contents = re.sub(71- r"^(\s*%s\s*=\s*')(.+?)(')" % pattern,72- inject_version, f.read(),73- flags=re.DOTALL | re.MULTILINE74- )75-76- if not changed:77- fail('Could not find %s in %s', pattern, filename)78-79- with open(filename, 'w') as f:80- f.write(contents)81-82-83-def set_init_version(version):84- info('Setting __init__.py version to %s', version)85- set_filename_version('flask/__init__.py', version, '__version__')86-87-88-def build():89- cmd = [sys.executable, 'setup.py', 'sdist', 'bdist_wheel']90- Popen(cmd).wait()91-92-93-def fail(message, *args):94- print('Error:', message % args, file=sys.stderr)95- sys.exit(1)96-97-98-def info(message, *args):99- print(message % args, file=sys.stderr)100-101-102-def get_git_tags():103- return set(104- Popen(['git', 'tag'], stdout=PIPE).communicate()[0].splitlines()105- )106-107-108-def git_is_clean():109- return Popen(['git', 'diff', '--quiet']).wait() == 0110-111-112-def make_git_commit(message, *args):113- message = message % args114- Popen(['git', 'commit', '-am', message]).wait()115-116-117-def make_git_tag(tag):118- info('Tagging "%s"', tag)119- Popen(['git', 'tag', tag]).wait()120-121-122-def main():123- os.chdir(os.path.join(os.path.dirname(__file__), '..'))124-125- rv = parse_changelog()126-127- if rv is None:128- fail('Could not parse changelog')129-130- version, release_date, codename = rv131- dev_version = bump_version(version) + '.dev'132-133- info(134- 'Releasing %s (codename %s, release date %s)',135- version, codename, release_date.strftime('%d/%m/%Y')136- )137- tags = get_git_tags()138-139- if version in tags:140- fail('Version "%s" is already tagged', version)141-142- if release_date.date() != date.today():143- fail(144- 'Release date is not today (%s != %s)',145- release_date.date(), date.today()146- )147-148- if not git_is_clean():149- fail('You have uncommitted changes in git')150-151- try:152- import wheel # noqa: F401153- except ImportError:154- fail('You need to install the wheel package.')155-156- set_init_version(version)157- make_git_commit('Bump version number to %s', version)158- make_git_tag(version)159- build()160- set_init_version(dev_version)161-162-163-if __name__ == '__main__':164- main()deleted:Makefile-35 removed
1-.PHONY: all install-dev test coverage cov test-all tox docs audit release clean-pyc upload-docs ebook2-3-all: test4-5-install-dev:6- pip install -q -e .[dev]7-8-test: clean-pyc install-dev9- pytest10-11-coverage: clean-pyc install-dev12- coverage run -m pytest13- coverage report14- coverage html15-16-cov: coverage17-18-test-all: install-dev19- tox20-21-tox: test-all22-23-docs: clean-pyc install-dev24- $(MAKE) -C docs html25-26-audit:27- python setup.py audit28-29-release:30- python scripts/make-release.py31-32-clean-pyc:33- find . -name '*.pyc' -exec rm -f {} +34- find . -name '*.pyo' -exec rm -f {} +35- find . -name '*~' -exec rm -f {} +modified:MANIFEST.in+5 added-8 removed
1-include Makefile CHANGES.rst CONTRIBUTING.rst LICENSE AUTHORS tox.ini2-1+include CHANGES.rst2+include CONTRIBUTING.rst3+include tox.ini4 graft artwork4-graft tests5-graft examples5 graft docs7-8-global-exclude *.py[co]9-6 prune docs/_build11-prune docs/_themes7+graft examples8+graft testsmodified:README.rst+2 added-4 removed
30 unmodified lines31 from flask import Flask32 33 app = Flask(__name__)34 35- @app.route('/')35+ @app.route("/")36 def hello():37- return 'Hello, World!'37+ return "Hello, World!"38 39 .. code-block:: text40 41 $ FLASK_APP=hello.py flask run16 unmodified lines58 -----59 60 * Website: https://www.palletsprojects.com/p/flask/61 * Documentation: http://flask.pocoo.org/docs/62-* License: `BSD <https://github.com/pallets/flask/blob/master/LICENSE>`_62 * Releases: https://pypi.org/project/Flask/63 * Code: https://github.com/pallets/flask64 * Issue tracker: https://github.com/pallets/flask/issues65 * Test status: https://dev.azure.com/pallets/pallets/_build?definitionId=267-* Test coverage: https://codecov.io/gh/pallets/flask66 * Official chat: https://discord.gg/t6rrQZH67 68 .. _WSGI: https://wsgi.readthedocs.io69 .. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/2 unmodified linesmodified:setup.cfg+4 added-8 removed
1-[aliases]2-release = egg_info -Db ''1+[metadata]2+license_file = LICENSE.rst3 4 [bdist_wheel]5-universal = 15+universal = true6 7-[metadata]8-license_file = LICENSE9-7 [tool:pytest]11-minversion = 3.08 testpaths = tests9 10 [coverage:run]11 branch = True4 unmodified lines16 [coverage:paths]17 source =18 flask19 .tox/*/lib/python*/site-packages/flask24- .tox/pypy/site-packages/flask20+ .tox/*/site-packages/flaskmodified:setup.py+57 added-62 removed
1-#!/usr/bin/env python2-# -*- coding: utf-8 -*-1 import io2 import re5-from collections import OrderedDict3 4+from setuptools import find_packages5 from setuptools import setup6 9-with io.open('README.rst', 'rt', encoding='utf8') as f:7+with io.open("README.rst", "rt", encoding="utf8") as f:8 readme = f.read()9 12-with io.open('flask/__init__.py', 'rt', encoding='utf8') as f:13- version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)10+with io.open("flask/__init__.py", "rt", encoding="utf8") as f:11+ version = re.search(r"__version__ = \'(.*?)\'", f.read()).group(1)12 13 setup(16- name='Flask',14+ name="Flask",15 version=version,18- url='https://www.palletsprojects.com/p/flask/',19- project_urls=OrderedDict((20- ('Documentation', 'http://flask.pocoo.org/docs/'),21- ('Code', 'https://github.com/pallets/flask'),22- ('Issue tracker', 'https://github.com/pallets/flask/issues'),23- )),24- license='BSD',25- author='Armin Ronacher',26- author_email='armin.ronacher@active-4.com',27- maintainer='Pallets team',28- maintainer_email='contact@palletsprojects.com',29- description='A simple framework for building complex web applications.',16+ url="https://palletsprojects.com/p/flask/",17+ project_urls={18+ "Documentation": "http://flask.palletsprojects.com/",19+ "Code": "https://github.com/pallets/flask",20+ "Issue tracker": "https://github.com/pallets/flask/issues",21+ },22+ license="BSD-3-Clause",23+ author="Armin Ronacher",24+ author_email="armin.ronacher@active-4.com",25+ maintainer="Pallets",26+ maintainer_email="contact@palletsprojects.com",27+ description="A simple framework for building complex web applications.",28 long_description=readme,31- packages=['flask', 'flask.json'],29+ classifiers=[30+ "Development Status :: 5 - Production/Stable",31+ "Environment :: Web Environment",32+ "Framework :: Flask",33+ "Intended Audience :: Developers",34+ "License :: OSI Approved :: BSD License",35+ "Operating System :: OS Independent",36+ "Programming Language :: Python",37+ "Programming Language :: Python :: 2",38+ "Programming Language :: Python :: 2.7",39+ "Programming Language :: Python :: 3",40+ "Programming Language :: Python :: 3.4",41+ "Programming Language :: Python :: 3.5",42+ "Programming Language :: Python :: 3.6",43+ "Topic :: Internet :: WWW/HTTP :: Dynamic Content",44+ "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",45+ "Topic :: Software Development :: Libraries :: Application Frameworks",46+ "Topic :: Software Development :: Libraries :: Python Modules",47+ ],48+ packages=find_packages(),49 include_package_data=True,33- zip_safe=False,34- platforms='any',50+ python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",51 install_requires=[36- 'Werkzeug>=0.14',37- 'Jinja2>=2.10',38- 'itsdangerous>=0.24',39- 'click>=5.1',52+ "Werkzeug>=0.14",53+ "Jinja2>=2.10",54+ "itsdangerous>=0.24",55+ "click>=5.1",56 ],57 extras_require={42- 'dotenv': ['python-dotenv'],43- 'dev': [44- 'pytest>=3',45- 'coverage',46- 'tox',47- 'sphinx',48- 'pallets-sphinx-themes',49- 'sphinxcontrib-log-cabinet',58+ "dotenv": ["python-dotenv"],59+ "dev": [60+ "pytest",61+ "coverage",62+ "tox",63+ "sphinx",64+ "pallets-sphinx-themes",65+ "sphinxcontrib-log-cabinet",66+ "sphinx-issues",67 ],51- 'docs': [52- 'sphinx',53- 'pallets-sphinx-themes',54- 'sphinxcontrib-log-cabinet',55- ]56- },57- classifiers=[58- 'Development Status :: 5 - Production/Stable',59- 'Environment :: Web Environment',60- 'Framework :: Flask',61- 'Intended Audience :: Developers',62- 'License :: OSI Approved :: BSD License',63- 'Operating System :: OS Independent',64- 'Programming Language :: Python',65- 'Programming Language :: Python :: 2',66- 'Programming Language :: Python :: 2.7',67- 'Programming Language :: Python :: 3',68- 'Programming Language :: Python :: 3.4',69- 'Programming Language :: Python :: 3.5',70- 'Programming Language :: Python :: 3.6',71- 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',72- 'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',73- 'Topic :: Software Development :: Libraries :: Application Frameworks',74- 'Topic :: Software Development :: Libraries :: Python Modules',75- ],76- entry_points={77- 'console_scripts': [78- 'flask = flask.cli:main',68+ "docs": [69+ "sphinx",70+ "pallets-sphinx-themes",71+ "sphinxcontrib-log-cabinet",72+ "sphinx-issues",73 ],74 },75+ entry_points={"console_scripts": ["flask = flask.cli:main"]},76 )