Skip to content
Myr

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

6 files+68 added−281 removed

deleted:scripts/make-release.py-164 removed
1#!/usr/bin/env python2from __future__ import print_function34import os5import re6import sys7from datetime import date, datetime8from subprocess import PIPE, Popen910_date_strip_re = re.compile(r'(?<=\d)(st|nd|rd|th)')111213def 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())1819 if match is None:20 continue2122 version = match.group(1).strip()2324 if next(lineiter).count('-') != len(match.group(0)):25 continue2627 while 1:28 change_info = next(lineiter).strip()2930 if change_info:31 break3233 match = re.search(34 r'released on (\w+\s+\d+\w+\s+\d+)(?:, codename (.*))?',35 change_info,36 flags=re.IGNORECASE37 )3839 if match is None:40 continue4142 datestr, codename = match.groups()43 return version, parse_date(datestr), codename444546def bump_version(version):47 try:48 parts = [int(i) for i in version.split('.')]49 except ValueError:50 fail('Current version is not numeric')5152 parts[-1] += 153 return '.'.join(map(str, parts))545556def parse_date(string):57 string = _date_strip_re.sub('', string)58 return datetime.strptime(string, '%B %d %Y')596061def set_filename_version(filename, version_number, pattern):62 changed = []6364 def inject_version(match):65 before, old, after = match.groups()66 changed.append(True)67 return before + version_number + after6869 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 )7576 if not changed:77 fail('Could not find %s in %s', pattern, filename)7879 with open(filename, 'w') as f:80 f.write(contents)818283def set_init_version(version):84 info('Setting __init__.py version to %s', version)85 set_filename_version('flask/__init__.py', version, '__version__')868788def build():89 cmd = [sys.executable, 'setup.py', 'sdist', 'bdist_wheel']90 Popen(cmd).wait()919293def fail(message, *args):94 print('Error:', message % args, file=sys.stderr)95 sys.exit(1)969798def info(message, *args):99 print(message % args, file=sys.stderr)100101102def get_git_tags():103 return set(104 Popen(['git', 'tag'], stdout=PIPE).communicate()[0].splitlines()105 )106107108def git_is_clean():109 return Popen(['git', 'diff', '--quiet']).wait() == 0110111112def make_git_commit(message, *args):113 message = message % args114 Popen(['git', 'commit', '-am', message]).wait()115116117def make_git_tag(tag):118 info('Tagging "%s"', tag)119 Popen(['git', 'tag', tag]).wait()120121122def main():123 os.chdir(os.path.join(os.path.dirname(__file__), '..'))124125 rv = parse_changelog()126127 if rv is None:128 fail('Could not parse changelog')129130 version, release_date, codename = rv131 dev_version = bump_version(version) + '.dev'132133 info(134 'Releasing %s (codename %s, release date %s)',135 version, codename, release_date.strftime('%d/%m/%Y')136 )137 tags = get_git_tags()138139 if version in tags:140 fail('Version "%s" is already tagged', version)141142 if release_date.date() != date.today():143 fail(144 'Release date is not today (%s != %s)',145 release_date.date(), date.today()146 )147148 if not git_is_clean():149 fail('You have uncommitted changes in git')150151 try:152 import wheel # noqa: F401153 except ImportError:154 fail('You need to install the wheel package.')155156 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)161162163if __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 ebook23all: test45install-dev:6 pip install -q -e .[dev]78test: clean-pyc install-dev9 pytest1011coverage: clean-pyc install-dev12 coverage run -m pytest13 coverage report14 coverage html1516cov: coverage1718test-all: install-dev19 tox2021tox: test-all2223docs: clean-pyc install-dev24 $(MAKE) -C docs html2526audit:27 python setup.py audit2829release:30 python scripts/make-release.py3132clean-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
1include Makefile CHANGES.rst CONTRIBUTING.rst LICENSE AUTHORS tox.ini21include CHANGES.rst2include CONTRIBUTING.rst3include tox.ini4graft artwork4graft tests5graft examples5graft docs78global-exclude *.py[co]96prune docs/_build11prune docs/_themes7graft examples8graft tests
modified:README.rst+2 added-4 removed
30 unmodified lines
31 from flask import Flask3233 app = Flask(__name__)3435 @app.route('/')35 @app.route("/")36 def hello():37 return 'Hello, World!'37 return "Hello, World!"3839.. code-block:: text4041 $ FLASK_APP=hello.py flask run
16 unmodified lines
58-----5960* 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/t6rrQZH6768.. _WSGI: https://wsgi.readthedocs.io69.. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/
2 unmodified lines
modified:setup.cfg+4 added-8 removed
1[aliases]2release = egg_info -Db ''1[metadata]2license_file = LICENSE.rst34[bdist_wheel]5universal = 15universal = true67[metadata]8license_file = LICENSE97[tool:pytest]11minversion = 3.08testpaths = tests910[coverage:run]11branch = True
4 unmodified lines
16[coverage:paths]17source =18 flask19 .tox/*/lib/python*/site-packages/flask24 .tox/pypy/site-packages/flask20 .tox/*/site-packages/flask
modified:setup.py+57 added-62 removed
1#!/usr/bin/env python2# -*- coding: utf-8 -*-1import io2import re5from collections import OrderedDict34from setuptools import find_packages5from setuptools import setup69with io.open('README.rst', 'rt', encoding='utf8') as f:7with io.open("README.rst", "rt", encoding="utf8") as f:8 readme = f.read()912with io.open('flask/__init__.py', 'rt', encoding='utf8') as f:13 version = re.search(r'__version__ = \'(.*?)\'', f.read()).group(1)10with io.open("flask/__init__.py", "rt", encoding="utf8") as f:11 version = re.search(r"__version__ = \'(.*?)\'", f.read()).group(1)1213setup(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)