diff --git a/.gitignore b/.gitignore index ac7de2e..5ebc5ac 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,14 @@ -*.pyc +# Temporary files .*.swp +*.pyc +*.pyo + +# Build-related files +docs/_build/ .coverage -htmlcov/ -tests/db/ +*.egg-info +*.egg +build/ dist/ -doc/_build/ +htmlcov/ MANIFEST diff --git a/ChangeLog b/ChangeLog deleted file mode 120000 index 36ab6c5..0000000 --- a/ChangeLog +++ /dev/null @@ -1 +0,0 @@ -doc/changelog.rst \ No newline at end of file diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..481d6a7 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,97 @@ +ChangeLog +========= + + +2.2.1 (2013-10-29) +------------------ + +*Bugfix:* + + * `#2 `_: Properly expose + :func:`~semantic_version.validate` as a top-level module function. + +2.2.0 (2013-03-22) +------------------ + +*Bugfix:* + + * `#1 `_: Allow partial + versions without minor or patch level + +*New:* + + * Add the :meth:`Version.coerce ` class method to + :class:`~semantic_version.Version` class for mapping arbitrary version strings to + semver. + * Add the :func:`~semantic_version.validate` method to validate a version + string against the SemVer rules. + * Full Python3 support + +2.1.2 (2012-05-22) +------------------ + +*Bugfix:* + + * Properly validate :class:`~semantic_version.django_fields.VersionField` and + :class:`~semantic_version.django_fields.SpecField`. + +2.1.1 (2012-05-22) +------------------ + +*New:* + + * Add introspection rules for south + +2.1.0 (2012-05-22) +------------------ + +*New:* + + * Add :func:`semantic_version.Spec.filter` (filter a list of :class:`~semantic_version.Version`) + * Add :func:`semantic_version.Spec.select` (select the highest + :class:`~semantic_version.Version` from a list) + * Update :func:`semantic_version.Version.__repr__` + +2.0.0 (2012-05-22) +------------------ + +*Backwards incompatible changes:* + + * Removed "loose" specification support + * Cleanup :class:`~semantic_version.Spec` to be more intuitive. + * Merge Spec and SpecList into :class:`~semantic_version.Spec`. + * Remove :class:`~semantic_version.django_fields.SpecListField` + +1.2.0 (2012-05-18) +------------------ + +*New:* + + * Allow split specifications when instantiating a + :class:`~semantic_version.SpecList`:: + + >>> SpecList('>=0.1.1', '!=0.1.3') == SpecList('>=0.1.1,!=0.1.3') + True + +1.1.0 (2012-05-18) +------------------ + +*New:* + + * Improved "loose" specification support (``>~``, ``<~``, ``!~``) + * Introduced "not equal" specifications (``!=``, ``!~``) + * :class:`~semantic_version.SpecList` class combining many :class:`~semantic_version.Spec` + * Add :class:`~semantic_version.django_fields.SpecListField` to store a :class:`~semantic_version.SpecList`. + +1.0.0 (2012-05-17) +------------------ + +First public release. + +*New:* + + * :class:`~semantic_version.Version` and :class:`~semantic_version.Spec` classes + * Related django fields: :class:`~semantic_version.django_fields.VersionField` + and :class:`~semantic_version.django_fields.SpecField` + +.. vim:et:ts=4:sw=4:tw=79:ft=rst: diff --git a/Makefile b/Makefile index 9ccf1e7..22e50d8 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ coverage: coverage html "--include=$(PACKAGE_DIR)/*.py,tests/*.py" doc: - $(MAKE) -C doc html + $(MAKE) -C docs html .PHONY: all default clean coverage doc test diff --git a/doc/changelog.rst b/doc/changelog.rst deleted file mode 100644 index 481d6a7..0000000 --- a/doc/changelog.rst +++ /dev/null @@ -1,97 +0,0 @@ -ChangeLog -========= - - -2.2.1 (2013-10-29) ------------------- - -*Bugfix:* - - * `#2 `_: Properly expose - :func:`~semantic_version.validate` as a top-level module function. - -2.2.0 (2013-03-22) ------------------- - -*Bugfix:* - - * `#1 `_: Allow partial - versions without minor or patch level - -*New:* - - * Add the :meth:`Version.coerce ` class method to - :class:`~semantic_version.Version` class for mapping arbitrary version strings to - semver. - * Add the :func:`~semantic_version.validate` method to validate a version - string against the SemVer rules. - * Full Python3 support - -2.1.2 (2012-05-22) ------------------- - -*Bugfix:* - - * Properly validate :class:`~semantic_version.django_fields.VersionField` and - :class:`~semantic_version.django_fields.SpecField`. - -2.1.1 (2012-05-22) ------------------- - -*New:* - - * Add introspection rules for south - -2.1.0 (2012-05-22) ------------------- - -*New:* - - * Add :func:`semantic_version.Spec.filter` (filter a list of :class:`~semantic_version.Version`) - * Add :func:`semantic_version.Spec.select` (select the highest - :class:`~semantic_version.Version` from a list) - * Update :func:`semantic_version.Version.__repr__` - -2.0.0 (2012-05-22) ------------------- - -*Backwards incompatible changes:* - - * Removed "loose" specification support - * Cleanup :class:`~semantic_version.Spec` to be more intuitive. - * Merge Spec and SpecList into :class:`~semantic_version.Spec`. - * Remove :class:`~semantic_version.django_fields.SpecListField` - -1.2.0 (2012-05-18) ------------------- - -*New:* - - * Allow split specifications when instantiating a - :class:`~semantic_version.SpecList`:: - - >>> SpecList('>=0.1.1', '!=0.1.3') == SpecList('>=0.1.1,!=0.1.3') - True - -1.1.0 (2012-05-18) ------------------- - -*New:* - - * Improved "loose" specification support (``>~``, ``<~``, ``!~``) - * Introduced "not equal" specifications (``!=``, ``!~``) - * :class:`~semantic_version.SpecList` class combining many :class:`~semantic_version.Spec` - * Add :class:`~semantic_version.django_fields.SpecListField` to store a :class:`~semantic_version.SpecList`. - -1.0.0 (2012-05-17) ------------------- - -First public release. - -*New:* - - * :class:`~semantic_version.Version` and :class:`~semantic_version.Spec` classes - * Related django fields: :class:`~semantic_version.django_fields.VersionField` - and :class:`~semantic_version.django_fields.SpecField` - -.. vim:et:ts=4:sw=4:tw=79:ft=rst: diff --git a/doc/Makefile b/docs/Makefile similarity index 100% rename from doc/Makefile rename to docs/Makefile diff --git a/doc/_static/.keep_dir b/docs/_static/.keep_dir similarity index 100% rename from doc/_static/.keep_dir rename to docs/_static/.keep_dir diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 120000 index 0000000..22ec9b8 --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1 @@ +../ChangeLog \ No newline at end of file diff --git a/doc/conf.py b/docs/conf.py similarity index 98% rename from doc/conf.py rename to docs/conf.py index 611f3c0..b8272ea 100644 --- a/doc/conf.py +++ b/docs/conf.py @@ -51,7 +51,7 @@ root_dir = os.path.abspath(os.path.dirname(__file__)) def get_version(): import re version_re = re.compile(r"^__version__ = '([\w_.-]+)'$") - with open(os.path.join(root_dir, os.pardir, 'src', 'semantic_version', '__init__.py')) as f: + with open(os.path.join(root_dir, os.pardir, 'semantic_version', '__init__.py')) as f: for line in f: match = version_re.match(line[:-1]) if match: diff --git a/doc/django.rst b/docs/django.rst similarity index 100% rename from doc/django.rst rename to docs/django.rst diff --git a/doc/index.rst b/docs/index.rst similarity index 100% rename from doc/index.rst rename to docs/index.rst diff --git a/doc/make.bat b/docs/make.bat similarity index 100% rename from doc/make.bat rename to docs/make.bat diff --git a/doc/reference.rst b/docs/reference.rst similarity index 100% rename from doc/reference.rst rename to docs/reference.rst diff --git a/src/semantic_version/__init__.py b/semantic_version/__init__.py similarity index 100% rename from src/semantic_version/__init__.py rename to semantic_version/__init__.py diff --git a/src/semantic_version/base.py b/semantic_version/base.py similarity index 100% rename from src/semantic_version/base.py rename to semantic_version/base.py diff --git a/src/semantic_version/compat.py b/semantic_version/compat.py similarity index 100% rename from src/semantic_version/compat.py rename to semantic_version/compat.py diff --git a/src/semantic_version/django_fields.py b/semantic_version/django_fields.py similarity index 100% rename from src/semantic_version/django_fields.py rename to semantic_version/django_fields.py diff --git a/setup.py b/setup.py index d24cdd0..8d2f9e6 100755 --- a/setup.py +++ b/setup.py @@ -2,90 +2,49 @@ # -*- coding: utf-8 -*- # Copyright (c) 2012-2013 Raphaël Barrois -from distutils.core import setup -from distutils import cmd import os import re import sys +from setuptools import setup + root_dir = os.path.abspath(os.path.dirname(__file__)) -def get_version(): - version_re = re.compile(r"^__version__ = '([\w_.-]+)'$") - with open(os.path.join(root_dir, 'src', 'semantic_version', '__init__.py')) as f: +def get_version(package_name): + version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$") + package_components = package_name.split('.') + path_components = package_components + ['__init__.py'] + with open(os.path.join(root_dir, *path_components)) as f: for line in f: match = version_re.match(line[:-1]) if match: return match.groups()[0] - return '0.0.0' + return '0.1.0' -class test(cmd.Command): - """Run the tests for this package.""" - command_name = 'test' - description = 'run the tests associated with the package' - - user_options = [ - ('test-suite=', None, "A test suite to run (defaults to 'tests')"), - ] - - DEFAULT_TEST_SUITE = 'tests' - - def initialize_options(self): - self.test_runner = None - self.test_suite = None - - def finalize_options(self): - self.ensure_string('test_suite', self.DEFAULT_TEST_SUITE) - - def run(self): - """Run the test suite.""" - try: - import unittest2 as unittest - except ImportError: - import unittest - - if self.verbose: - verbosity=1 - else: - verbosity=0 - - ex_path = sys.path - sys.path.insert(0, os.path.join(root_dir, 'src')) - loader = unittest.defaultTestLoader - suite = unittest.TestSuite() - - if self.test_suite == self.DEFAULT_TEST_SUITE: - for test_module in loader.discover('.'): - suite.addTest(test_module) - else: - suite.addTest(loader.loadTestsFromName(self.test_suite)) - - result = unittest.TextTestRunner(verbosity=verbosity).run(suite) - sys.path = ex_path - - if not result.wasSuccessful(): - sys.exit(1) +PACKAGE = 'semantic_version' setup( - name="semantic_version", - version=get_version(), + name=PACKAGE, + version=get_version(PACKAGE), author="Raphaël Barrois", author_email="raphael.barrois+semver@polytechnique.org", - description=("A library implementing the 'SemVer' scheme."), - license="BSD", + description="A library implementing the 'SemVer' scheme.", + license='BSD', keywords=['semantic version', 'versioning', 'version'], - url="http://github.com/rbarrois/python-semanticversion", - download_url="http://pypi.python.org/pypi/semantic_version/", - package_dir={'': 'src'}, + url='https://github.com/rbarrois/python-semanticversion', + download_url='http://pypi.python.org/pypi/semantic_version/', packages=['semantic_version'], + setup_requires=[ + 'setuptools>=0.8', + ], classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Topic :: Software Development :: Libraries :: Python Modules", + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Topic :: Software Development :: Libraries :: Python Modules', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', @@ -96,6 +55,5 @@ setup( 'Programming Language :: Python :: 3.3', 'Topic :: Software Development :: Libraries :: Python Modules' ], - cmdclass={'test': test}, + test_suite='tests', ) -