...
 
Commits (16)
repo: 9addf825bc8fc3deaf09e724a16cb98b35c53c76
node: f28f87a629e3e6eadf6cc965f7b07fb64a016480
branch: default
tag: 2.0.2
language: python
os:
- linux
python:
- "2.7"
- "3.5"
- "3.6"
- "nightly" # currently points to 3.7-dev
- "pypy"
- "pypy3"
# command to run tests
install: python setup.py develop
# Nothing needed
script: python setup.py test
Testing
=======
Run tests:
$ python -m unittest pyroma.tests
Some notes on developing
========================
......@@ -23,4 +30,3 @@ You do it this way:
$ cd pyroma/testdata/complete
$ python setup.py sdist --formats=bztar,gztar,tar,zip
$ cp dist/complete-1.0.dev1.* ../distributions/
Changelog
=========
2.3.1 (2018-05-28)
------------------
- Fixed #12: Installation fails with a non-UTF8 locale under Python 3.
[ericof, 4383, regebro]
2.3 (2017-11-28)
----------------
- Check that a classifier specifies the project license. [4383]
- Dropped support for Python 2.6, 3.3 and 3.4.
- Fixed a unicode issue [gotcha]
- Stopped recommending places to keep documentation.
2.2 (2016-10-26)
----------------
- Removed the TestSuite rating. I decided it was too close to looking at
code quality. Pyroma no longer cares if you have tests or not.
- Fixed #36: PyPI now requires https.
2.1 (2016-10-18)
----------------
- #35: Support for PEP-440.
2.0.2 (2016-03-06)
------------------
......
......@@ -3,3 +3,5 @@ recursive-include pyroma/testdata *.py *.txt *.cfg *.html
prune pyroma/testdata/complete/*.egg
graft pyroma/testdata/distributions
include tox.ini
include DEVELOPMENT.rst
include Makefile
.PHONY: docs
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
help: ## display this message
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
generate: ## generate environment for tests
cd pyroma/testdata/complete
python setup.py sdist --formats=bztar,gztar,tar,zip
cp pyroma/testdata/complete/dist/complete-1.0.dev1.* pyroma/testdata/distributions/
tests: generate ## run tests
python -m unittest pyroma.tests
clean: clean-pyc ## remove all
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
find . -name 'pip-selfcheck.json' -exec rm -fr {} +
find . -name 'pyvenv.cfg' -exec rm -fr {} +
pyroma
======
Pyroma rhymes with aroma, and is a product aimed at giving a rating of how well
a Python project complies with the best practices of the Python packaging
ecosystem, primarily PyPI, pip, Distribute etc, as well as a list of issues that
could be improved.
The aim of this is both to help people make a project that is nice and usable,
but also to improve the quality of Python third-party software, making it easier
and more enjoyable to use the vast array of available modules for Python.
It's written so that there are a library with methods to call from Python, as
well as a script, also called pyroma.
It can be run on a project directory before making a release:
$ pyroma .
On a distribution before uploading it to the CheeseShop:
$ pyroma pyroma-1.0.tar.gz
Or you can give it a package name on CheeseShop:
$ pyroma pyroma
Giving it a name on CheeseShop is the most extensive test, as it will
test for several things isn't otherwise tested.
In all cases the output is similar::
------------------------------
Checking .
Found pyroma
------------------------------
The packages long_description is quite short.
------------------------------
Final rating: 9/10
Cottage Cheese
------------------------------
Tests
-----
This is the list of checks that are currently performed:
* The package should have a name, a version and a Description.
If it does not, it will receive a rating of 0.
* The version number should be a string. A floating point number will
work with distutils, but most other tools will fail.
* The version number should comply to PEP386.
* The long_description should be over a 100 characters.
* Pyroma will convert your long_description to HTML using Docutils, to
verify that it is possible. This guarantees pretty formatting of your
description on PyPI. As long as Docutils can convert it, this passes,
even if there are warnings or error in the conversion. These warnings
and errors are printed to stdout so you will see them.
* You should have a the following meta data fields filled in:
classifiers, keywords, author, author_email, url and license.
* You should have classifiers specifying the supported Python versions.
* You should have a classifier specifying the project license.
* If you are using setuptools or distribute you should specify zip_safe,
as it defaults to "true" and that's probably not what you want.
* If you are using setuptools or distribute you can specify a test_suite
to run tests with 'setup.py test'. This makes it easy to run tests for
both humans and automated tools.
* If you are checking on a PyPI package, and not a local directory or
local package, pyroma will check the number of owners the package has
on PyPI. It should be three or more, to minimize the "Bus factor",
the risk of the index owners suddenly going off-line for whatever reason.
* If you are checking on a PyPI package, and not a local directory or
local package, Pyroma will look for documentation for your package at
pythonhosted.org and readthedocs.org. If it can't find it, it prints out
a message to that effect. However, since you may have documentation
elsewhere, this does not affect your rating.
Credits
-------
The project was created by Lennart Regebro, regebro@gmail.com
The name "Pyroma" was coined by Wichert Akkerman, wichert@wiggy.net
Contributors:
* Godefroid Chapelle
* Dmitry Vakhrushev
* hugovk
* Jeff Quast
* Maurits van Rees
* Hervé Beraud
* Érico Andrei
pyroma
======
Pyroma rhymes with aroma, and is a product aimed at giving a rating of how well
a Python project complies with the best practices of the Python packaging
ecosystem, primarily PyPI, pip, Distribute etc, as well as a list of issues that
could be improved.
The aim of this is both to help people make a project that is nice and usable,
but also to improve the quality of Python third-party software, making it easier
and more enjoyable to use the vast array of available modules for Python.
It's written so that there are a library with methods to call from Python, as
well as a script, also called pyroma.
It can be run on a project directory before making a release:
$ pyroma .
On a distribution before uploading it to the CheeseShop:
$ pyroma pyroma-1.0.tar.gz
Or you can give it a package name on CheeseShop:
$ pyroma pyroma
Giving it a name on CheeseShop is the most extensive test, as it will
test for several things isn't otherwise tested.
In all cases the output is similar::
------------------------------
Checking .
Found pyroma
------------------------------
The packages long_description is quite short.
------------------------------
Final rating: 9/10
Cottage Cheese
------------------------------
Tests
-----
This is the list of checks that are currently performed:
* The package should have a name, a version and a Description.
If it does not, it will receive a rating of 0.
* The version number should be a string. A floating point number will
work with distutils, but most other tools will fail.
* The version number should comply to PEP386.
* The long_description should be over a 100 characters.
* Pyroma will convert your long_description to HTML using Docutils, to
verify that it is possible. This guarantees pretty formatting of your
description on PyPI. As long as Docutils can convert it, this passes,
even if there are warnings or error in the conversion. These warnings
and errors are printed to stdout so you will see them.
* You should have a the following meta data fields filled in:
classifiers, keywords, author, author_email, url and license.
* You should have classifiers specifying the sypported Python versions.
* If you are using setuptools or distribute you should specify zip_safe,
as it defaults to "true" and that's probably not what you want.
* If you are using setuptools or distribute you can specify a test_suite
to run tests with 'setup.py test'. This makes it easy to run tests for
both humans and automated tools.
* If you are checking on a PyPI package, and not a local directory or
local package, pyroma will check the number of owners the package has
on PyPI. It should be three or more, to minimize the "Bus factor",
the risk of the index owners suddenly going off-line for whatever reason.
* If you are checking on a PyPI package, and not a local directory or
local package, Pyroma will look for documentation for your package at
pythonhosted.org and readthedocs.org. If it can't find it, it prints out
a message to that effect. However, since you may have documentation
elsewhere, this does not affect your rating.
Credits
-------
The project was created by Lennart Regebro, regebro@gmail.com
The name "Pyroma" was coined by Wichert Akkerman, wichert@wiggy.net
Contributors:
* Godefroid Chapelle
* Dmitry Vakhrushev
* hugovk
* Jeff Quast
* Maurits van Rees
See README.rst
pyroma (2.3-1) unstable; urgency=medium
* Add dependency on python3-distutils. Thanks Matthias Klose
(Closes: #896227)
* New upstream release
-- Federico Ceratto <federico@debian.org> Sat, 28 Apr 2018 15:59:20 +0100
pyroma (2.0.2-1) unstable; urgency=medium
* New upstream release (Closes: #828080)
......
**/*.pyc
*.egg-info/*
......@@ -3,7 +3,7 @@ Section: python
Priority: optional
Maintainer: Federico Ceratto <federico@debian.org>
Build-Depends:
debhelper (>= 9~)
debhelper (>= 11~)
Build-Depends-Indep:
dh-python,
python-all (>= 2.6.6-3~),
......@@ -12,12 +12,12 @@ Build-Depends-Indep:
python3-all,
python3-docutils,
python3-setuptools
Standards-Version: 3.9.8
Homepage: https://bitbucket.org/regebro/pyroma
Standards-Version: 4.1.4
Homepage: https://github.com/regebro/pyroma
X-Python-Version: >= 2.7
X-Python3-Version: >= 3.2
Vcs-Git: https://anonscm.debian.org/git/collab-maint/pyroma.git
Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/pyroma.git
Vcs-Git: https://salsa.debian.org/debian/pyroma.git
Vcs-Browser: https://salsa.debian.org/debian/pyroma
Package: python-pyroma
Architecture: all
......@@ -35,6 +35,7 @@ Description: Python packaging quality checker
Package: python3-pyroma
Architecture: all
Depends:
python3-distutils,
${python3:Depends},
${misc:Depends}
Recommends: ${python:Recommends}
......
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: pyroma
Source: https://bitbucket.org/regebro/pyroma
Source: https://github.com/regebro/pyroma
Files: *
Copyright: © 2011-2014, Lennart Regebro <regebro@gmail.com>
......
DEVELOPMENT.txt
README.txt
DEVELOPMENT.rst
README.rst
#!/usr/bin/make -f
# -*- makefile -*-
export PYBUILD_NAME=pyroma
export PYBUILD_DISABLE=test
export DH_VERBOSE=1
export http_proxy = http://127.0.0.1:9
export https_proxy = https://127.0.0.1:9
# Force UTF-8 locale
export LC_ALL=C.UTF-8
%:
dh $@ --with python2,python3 --buildsystem=pybuild --test-tox
dh $@ --with python2,python3 --buildsystem=pybuild
override_dh_installchangelogs:
dh_installchangelogs HISTORY.txt
......
version=3
https://bitbucket.org/regebro/pyroma/downloads .*/(\d\S*)\.tar\.gz
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/pyroma-$1\.tar\.gz/ \
https://github.com/regebro/pyroma/tags .*/v?(\d\S*)\.tar\.gz
......@@ -17,7 +17,7 @@ READTHEDOCS_RE = re.compile(r'(https?://.*?\.readthedocs.org)')
def _get_client():
# I think I should be able to monkeypatch a mock-thingy here... I think.
return xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
return xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
def get_data(project):
......@@ -60,17 +60,9 @@ def get_data(project):
data['_owners'] = [x.strip() for x in owners.split(',')]
logging.debug("Looking for documentation")
# See if there is any docs on http://pythonhosted.org
data['_packages_docs'] = False
try:
page = urllib.urlopen('http://pythonhosted.org/' + project)
if page.code == 200:
data['_packages_docs'] = True
except urllib.HTTPError:
pass
# Maybe on readthedocs?
# See if there is any docs on readthedocs
data['_readthe_docs'] = False
#import pdb;pdb.set_trace()
rtdocs = READTHEDOCS_RE.search(html)
if rtdocs:
page = urllib.urlopen(rtdocs.groups()[0])
......
......@@ -25,17 +25,17 @@ try:
except NameError:
stringtypes = str,
LEVELS = ["This cheese seems to contain no dairy products",
"Vieux Bologne",
"Limburger",
"Gorgonzola",
"Stilton",
"Brie",
"Comté",
"Jarlsberg",
"Philadelphia",
"Cottage Cheese",
"Your cheese is so fresh most people think it's a cream: Mascarpone"]
LEVELS = [u"This cheese seems to contain no dairy products",
u"Vieux Bologne",
u"Limburger",
u"Gorgonzola",
u"Stilton",
u"Brie",
u"Comté",
u"Jarlsberg",
u"Philadelphia",
u"Cottage Cheese",
u"Your cheese is so fresh most people think it's a cream: Mascarpone"]
class BaseTest(object):
......@@ -74,7 +74,7 @@ class VersionIsString(BaseTest):
def message(self):
return 'The version number should be a string.'
VERSION_RE = re.compile(r'''
PEP386_RE = re.compile(r'''
^
(?P<version>\d+\.\d+) # minimum 'N.N'
(?P<extraversion>(?:\.\d+)*) # any number of extra '.N' segments
......@@ -84,20 +84,59 @@ VERSION_RE = re.compile(r'''
(?P<prerelversion>\d+(?:\.\d+)*)
)?
(?P<postdev>(\.post(?P<post>\d+))?(\.dev(?P<dev>\d+))?)?
$''', re.VERBOSE)
$''', re.VERBOSE | re.IGNORECASE)
class PEP386Version(BaseTest):
PEP440_RE = re.compile(r"""^
v?
(?:
(?:(?P<epoch>[0-9]+)!)? # epoch
(?P<release>[0-9]+(?:\.[0-9]+)*) # release segment
(?P<pre> # pre-release
[-_\.]?
(?P<pre_l>(a|b|c|rc|alpha|beta|pre|preview))
[-_\.]?
(?P<pre_n>[0-9]+)?
)?
(?P<post> # post release
(?:-(?P<post_n1>[0-9]+))
|
(?:
[-_\.]?
(?P<post_l>post|rev|r)
[-_\.]?
(?P<post_n2>[0-9]+)?
)
)?
(?P<dev> # dev release
[-_\.]?
(?P<dev_l>dev)
[-_\.]?
(?P<dev_n>[0-9]+)?
)?
)
(?:\+(?P<local>[a-z0-9]+(?:[-_\.][a-z0-9]+)*))? # local version
$""", re.VERBOSE | re.IGNORECASE)
class PEPVersion(BaseTest):
weight = 50
pep386 = False
def test(self, data):
# Check that the version number complies to PEP-386:
version = data.get('version')
match = VERSION_RE.search(str(version))
self.pep386 = False
if PEP386_RE.search(str(version)) is not None:
# Matches the old PEP386
self.weight = 10
self.pep386 = True
match = PEP440_RE.search(str(version))
return match is not None
def message(self):
return "The package's version number does not comply with PEP-386."
if self.pep386:
return "The package's version number complies only with PEP-386 and not PEP-440."
return "The package's version number does not comply with PEP-386 or PEP-440."
class Description(BaseTest):
......@@ -210,41 +249,36 @@ class License(FieldTest):
field = 'license'
class ZipSafe(BaseTest):
class LicenceClassifier(BaseTest):
weight = 20
def test(self, data):
if data.get('_setuptools'):
self.weight = 20
return 'zip_safe' in data
else:
self.weight = 0
return True
classifiers = data.get('classifiers', [])
for classifier in classifiers:
parts = [p.strip() for p in classifier.split('::')]
if parts[0] == 'License':
# license classifier exist
return True
return False
def message(self):
return "You are using Setuptools or Distribute but do not specify if "\
"this package is zip_safe or not. You should specify it, as "\
"it defaults to True, which you probably do not want."
return "You should specify license in classifiers."
class TestSuite(BaseTest):
class ZipSafe(BaseTest):
def test(self, data):
if data.get('_setuptools'):
self.weight = 50
if 'test_suite' in data:
return True
if 'cmdclass' in data:
if 'test' in data.get('cmdclass', []):
return True
return False
self.weight = 20
return 'zip_safe' in data
else:
self.weight = 0
return True
def message(self):
return "Setuptools and Distribute support running tests. By "\
"specifying a test suite, it's easy to find and run tests "\
"both for automated tools and humans."
return "You are using Setuptools or Distribute but do not specify if "\
"this package is zip_safe or not. You should specify it, as "\
"it defaults to True, which you probably do not want."
class SDist(BaseTest):
......@@ -267,11 +301,10 @@ class PackageDocs(BaseTest):
weight = 0 # Just a recommendation
def test(self, data):
return data.get('_packages_docs') or data.get('_readthe_docs')
return data.get('_readthe_docs')
def message(self):
return "You might want to host your documentation on pythonhosted.org"\
" or readthedocs.org."
return "You might want to host your documentation on readthedocs.org."
class ValidREST(BaseTest):
......@@ -320,7 +353,7 @@ ALL_TESTS = [
Name(),
Version(),
VersionIsString(),
PEP386Version(),
PEPVersion(),
Description(),
LongDescription(),
Classifiers(),
......@@ -330,8 +363,8 @@ ALL_TESTS = [
AuthorEmail(),
Url(),
License(),
LicenceClassifier(),
ZipSafe(),
TestSuite(),
SDist(),
PackageDocs(),
ValidREST(),
......@@ -360,7 +393,7 @@ def rate(data):
good += test.weight
# If res is None, it's ignored.
if fatality:
# A fatal tests failed. That means we give a 0 rating:
# A fatal test failed. That means we give a 0 rating:
return 0, fails
# Multiply good by 9, and add 1 to get a rating between
# 1: All non-fatal tests failed.
......
......@@ -16,6 +16,7 @@ setup(name='complete',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'License :: OSI Approved :: MIT License',
],
keywords=['pypi', 'quality', 'example'],
author='Lennart Regebro',
......
......@@ -341,7 +341,7 @@
<a href="#downloads">Downloads &darr;</a>
|
<a href="http://pythonhosted.org/complete">Package Documentation</a>
<a href="http://complete.readthedocs.org/">Package Documentation</a>
</p>
......@@ -437,7 +437,7 @@ Installing and using complete for Python 3 code works exactly
the same as for Python 2 code, but complete also helps you to support
Python 2 and Python 3 from the same source code by letting you run 2to3
on the code as a part of the build process, by setting the keyword parameter
<tt class="docutils literal">use_2to3</tt> to True. See <a class="reference external" href="http://pythonhosted.org/complete">http://pythonhosted.org/complete</a> for more
<tt class="docutils literal">use_2to3</tt> to True. See <a class="reference external" href="http://complete.readthedocs.org/">http://complete.readthedocs.org/</a> for more
information.</p>
</li>
<li><p class="first">Refactoring the code, and releasing it in several distributions.
......@@ -445,7 +445,7 @@ This work is being done in the 0.7.x series but not yet released.</p>
</li>
</ul>
<p>The roadmap is still evolving, and the page that is up-to-date is
located at : <cite>http://pythonhosted.org/complete/roadmap</cite>.</p>
located at : <cite>http://complete.readthedocs.org//roadmap</cite>.</p>
<p>If you install <cite>complete</cite> and want to switch back for any reason to
<cite>Setuptools</cite>, get to the <a class="reference internal" href="#uninstallation-instructions">Uninstallation instructions</a> section.</p>
......@@ -453,7 +453,7 @@ located at : <cite>http://pythonhosted.org/complete/roadmap</cite>.</p>
<div class="section" id="more-documentation">
<h3><a class="toc-backref" href="#id26">More documentation</a></h3>
<p>You can get more information in the Sphinx-based documentation, located
at <a class="reference external" href="http://pythonhosted.org/complete">http://pythonhosted.org/complete</a>. This documentation includes the old
at <a class="reference external" href="http://complete.readthedocs.org/">http://complete.readthedocs.org/</a>. This documentation includes the old
Setuptools documentation that is slowly replaced, and brand new content.</p>
</div>
......@@ -972,7 +972,7 @@ This closes <a class="reference external" href="http://bitbucket.org/tarek/compl
<li>
<strong>Documentation:</strong>
<a href="http://pythonhosted.org/complete">complete package documentation</a>
<a href="http://complete.readthedocs.org/">complete package documentation</a>
</li>
<!-- The <th> elements below are a terrible terrible hack for setuptools -->
......@@ -980,7 +980,7 @@ This closes <a class="reference external" href="http://bitbucket.org/tarek/compl
<strong>Home Page:</strong>
<!-- <th>Home Page -->
<a href="http://pythonhosted.org/complete">http://pythonhosted.org/complete</a>
<a href="http://complete.readthedocs.org/">http://complete.readthedocs.org/</a>
</li>
......@@ -1149,4 +1149,4 @@ This closes <a class="reference external" href="http://bitbucket.org/tarek/compl
</div>
</div>
</body>
</html>
\ No newline at end of file
</html>
from datetime import datetime
args = ('http://pypi.python.org/pypi',)
args = ('https://pypi.python.org/pypi',)
kw = {}
data = {'package_releases':
{('complete',): ['1.0.dev1']},
......@@ -49,6 +49,7 @@ imperdiet enim nec velit posuere id dignissim massa molestie.""",
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'License :: OSI Approved :: MIT License',
],
'name': 'complete',
'license': 'MIT',
......
from datetime import datetime
args = ('http://pypi.python.org/pypi',)
args = ('https://pypi.python.org/pypi',)
kw = {}
data = {'package_releases':
{('distribute',): ['0.6.15']},
......
......@@ -32,6 +32,7 @@ COMPLETE = {'_setuptools': True,
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'License :: OSI Approved :: MIT License',
],
'keywords': ['pypi', 'quality', 'example'],
'author': 'Lennart Regebro',
......@@ -47,20 +48,18 @@ class FakeResponse(object):
def __init__(self, responsecode, filename=None):
self.filename = filename
self.headers = collections.defaultdict(lambda: None)
if sys.version > '2.5':
# 2.5 and lower doesn't have the code attribute.
# The test should fail on Python 2.5.
self.code = responsecode
self.code = responsecode
def read(self):
return open(self.filename, 'rb').read()
def urlopenstub(url):
if url.startswith('http://pythonhosted.org/'):
filename = [x for x in url.split('/') if x][-1]
if url.find('readthedocs.org') != -1:
host = url.split('/')[2]
package = host.split('.')[0]
# Faking the docs:
if filename in ('distribute', 'complete',):
if package in ('distribute', 'complete',):
return FakeResponse(200)
else:
# This package doesn't have docs on pythonhosted.org:
......@@ -147,7 +146,7 @@ class RatingsTest(unittest.TestCase):
rating = rate(data)
self.assertEqual(rating, (2, [
"The package's version number does not comply with PEP-386.",
"The package's version number does not comply with PEP-386 or PEP-440.",
"The package's description should be longer than 10 characters.",
"The package's long_description is quite short.",
"Your package does not have classifiers data.",
......@@ -157,12 +156,10 @@ class RatingsTest(unittest.TestCase):
"Your package does not have author_email data.",
"Your package does not have url data.",
"Your package does not have license data.",
"You should specify license in classifiers.",
"You are using Setuptools or Distribute but do not specify if "
"this package is zip_safe or not. You should specify it, as it "
"defaults to True, which you probably do not want.",
"Setuptools and Distribute support running tests. By specifying a "
"test suite, it's easy to find and run tests both for automated "
"tools and humans.",
]))
def test_lacking(self):
......@@ -181,12 +178,10 @@ class RatingsTest(unittest.TestCase):
"Your package does not have author_email data.",
"Your package does not have url data.",
"Your package does not have license data.",
"You should specify license in classifiers.",
"You are using Setuptools or Distribute but do not specify if "
"this package is zip_safe or not. You should specify it, as it "
"defaults to True, which you probably do not want.",
"Setuptools and Distribute support running tests. By specifying a "
"test suite, it's easy to find and run tests both for automated "
"tools and humans.",
]))
def test_custom_test(self):
......@@ -196,7 +191,7 @@ class RatingsTest(unittest.TestCase):
rating = rate(data)
self.assertEqual(rating, (2, [
"The package's version number does not comply with PEP-386.",
"The package's version number does not comply with PEP-386 or PEP-440.",
"The package's description should be longer than 10 characters.",
"The package's long_description is quite short.",
"Your package does not have classifiers data.",
......@@ -206,6 +201,7 @@ class RatingsTest(unittest.TestCase):
"Your package does not have author_email data.",
"Your package does not have url data.",
"Your package does not have license data.",
"You should specify license in classifiers.",
"You are using Setuptools or Distribute but do not specify if "
"this package is zip_safe or not. You should specify it, as it "
"defaults to True, which you probably do not want.",
......@@ -228,6 +224,7 @@ class PyPITest(unittest.TestCase):
self.assertEqual(rating, (9, [
'The classifiers should specify what minor versions of Python '
'you support as well as what major version.',
'You might want to host your documentation on readthedocs.org.',
'You should have three or more owners of the project on PyPI.'
]))
finally:
......
from setuptools import setup, find_packages
from io import open
version = '2.0.2'
version = '2.3.1'
long_description = (open("README.rst", 'rt', encoding='UTF-8').read() + "\n" +
open("HISTORY.txt", 'rt', encoding='UTF-8').read())
setup(name='pyroma',
version=version,
description="Test your project's packaging friendliness",
long_description=open("README.txt", 'rt').read() + "\n" +
open("HISTORY.txt", 'rt').read(),
long_description=long_description,
# Get more strings from
# http://pypi.python.org/pypi?:action=list_classifiers
classifiers=[
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: Jython",
"License :: OSI Approved :: MIT License",
],
keywords=['pypi', 'quality', 'testing'],
author='Lennart Regebro',
author_email='regebro@gmail.com',
url='https://bitbucket.org/regebro/pyroma',
url='https://github.com/regebro/pyroma',
license='MIT',
packages=find_packages(exclude=['ez_setup']),
include_package_data=True,
......
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py26, py27, py32, py33, py34, pypy
[testenv]
commands = python setup.py test
deps =
docutils