Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
posita committed Mar 14, 2017
1 parent 4c5258b commit 2f025b2
Show file tree
Hide file tree
Showing 22 changed files with 95 additions and 87 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Expand Up @@ -16,11 +16,11 @@
/.tox/
/build/
/dist/
/doc/_build/
/doc/_static/
/doc/modules.rst
/doc/dimgx.rst
/doc/dimgx.*.rst
/docs/_build/
/docs/_static/
/docs/modules.rst
/docs/dimgx.rst
/docs/dimgx.*.rst
/htmlcov/
__pycache__/
_trial_temp
Expand Down
11 changes: 11 additions & 0 deletions .pylintrc
@@ -1,3 +1,14 @@
# -*- encoding: utf-8; mode: ini -*-

# ========================================================================
# Copyright and other protections apply. Please see the accompanying
# ``LICENSE`` and ``CREDITS`` files for rights and restrictions governing
# use of this software. All rights not expressly waived or licensed are
# reserved. If those files are missing or appear to be modified from their
# originals, then please contact the author before viewing or using this
# software in any capacity.
# ========================================================================

[MESSAGES CONTROL]
disable=C,R,fixme,locally-disabled,missing-super-argument,no-init,no-member
enable=useless-suppression
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Expand Up @@ -9,16 +9,17 @@
# software in any capacity.
# ========================================================================

sudo: false
language: python

python:
- "2.7"
- pypy
- "3.3"
- "3.4"
- "3.5"
- "3.6"
- pypy3
- "pypy"
- "pypy3"

install:
- pip install coveralls tox-travis
Expand All @@ -29,7 +30,7 @@ matrix:
- python: "3.6"

# PyPy3 is experimental
- python: pypy3
- python: "pypy3"

script:
- tox
Expand Down
5 changes: 3 additions & 2 deletions CREDITS
@@ -1,6 +1,9 @@
``CREDITS``
===========

Contributors
------------

The following individuals or entities have contributed to this software.

By adding your name to this list, you grant a nonexclusive, perpetual
Expand All @@ -13,7 +16,5 @@ by a third party for this software's owner's otherwise lawful use of your
contribution, whether or not such use was contemplated by you at the time
you made it.

Contributors:

.. Entry format:
.. * `NAME <CONTACT_URL>`__ (see `REPO_URL <REPO_URL>`__)
11 changes: 0 additions & 11 deletions MANIFEST.in
Expand Up @@ -12,17 +12,6 @@
include \
CREDITS \
LICENSE \
doc/CREDITS.rst \
doc/LICENSE.rst \
doc/Makefile \
doc/cli.rst \
doc/conf.py \
doc/contrib.rst \
doc/index.rst \
doc/intro.rst \
doc/py.rst \
doc/release_checklist.md \
doc/requirements.txt \
test/requirements.txt

graft test/data
6 changes: 3 additions & 3 deletions dimgx.py
Expand Up @@ -503,15 +503,15 @@ def _is_broken():

_LOGGER.debug('patching broken %s from %s, %s', tarfile.TarFile.next, tarfile.__file__, sys_version)

def _wrap_next(_f):
def _wrap_next(f):
from functools import wraps

@wraps(_f)
@wraps(f)
def __patched_next(self, *args, **kw):
if self.offset < self.fileobj.tell():
self.fileobj.seek(self.offset)

return _f(self, *args, **kw)
return f(self, *args, **kw)

return __patched_next

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions doc/conf.py → docs/conf.py
Expand Up @@ -16,7 +16,7 @@
import shlex
import sys
sys.path.append('..')
from setup import _SETUP_ARGS
from setup import SETUP_ARGS

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -58,16 +58,16 @@
master_doc = 'index'

# General information about the project.
project = _SETUP_ARGS['name']
author = _SETUP_ARGS['author']
project = SETUP_ARGS['name']
author = SETUP_ARGS['author']
copyright = u'2014-2017, {}'.format(author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = _SETUP_ARGS['version']
release = SETUP_ARGS['version']
# The short X.Y version.
version = '.'.join(release.split('.')[:2])

Expand Down Expand Up @@ -279,8 +279,8 @@
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, '{}'.format(project), '{} Documentation'.format(project),
author, project, _SETUP_ARGS['description'],
_SETUP_ARGS['classifiers'][0]),
author, project, SETUP_ARGS['description'],
SETUP_ARGS['classifiers'][0]),
]

# Documents to append as an appendix to all manuals.
Expand Down
14 changes: 8 additions & 6 deletions doc/contrib.rst → docs/contrib.rst
Expand Up @@ -36,11 +36,13 @@ Submission Guidelines
If you're willing and able, consider `submitting a pull request <https://github.com/posita/dimgx/pulls>`__ (PR) with a fix.
There are only a few guidelines:

* If it isn't already there, please add your name (and optionally your GitHub username, email, website address, or other contact information) to the ``CREDITS`` file::
* If it isn't already there, please add your name (and optionally your GitHub username, email, website address, or other contact information) to the ``CREDITS`` file:

...
* Gordon the Turtle <https://github.com/GordonTheTurtle>
...
.. code-block:: rst
...
* `Gordon the Turtle <https://github.com/GordonTheTurtle>`_
...
* Try to follow the source conventions as you observe them.
(Note: I have purposely avoided aspects of `PEP8 <https://www.python.org/dev/peps/pep-0008/>`_, in part because I have adopted conventions developed from my experiences with other languages, but mostly because I'm growing older and more stubborn.)
Expand All @@ -50,9 +52,9 @@ There are only a few guidelines:
* Provide unit tests where feasible and appropriate.
At the very least, existing tests should not fail.
(There are exceptions, but if there is any doubt, they probably don't apply.)
Tests can be run with ``./runtests.sh`` (requires `tox <https://tox.readthedocs.org/en/latest/>`__) or ``python setup.py test``.

..
Unit tests live in ``./test``.
Tests can be run with ``./helpers/runtests.sh`` (requires `tox <https://tox.readthedocs.org/en/latest/>`__) or ``python setup.py test``.

* If you need me, mention me (|@posita|_) in your comment, and describe specifically how I can help.

Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions doc/intro.rst → docs/intro.rst
Expand Up @@ -26,6 +26,7 @@ License
-------

``dimgx`` is licensed under the `MIT License <http://opensource.org/licenses/MIT>`_.
See the :doc:`LICENSE <LICENSE>` file for details.
Source code is `available on GitHub <https://github.com/posita/dimgx>`__.

Installation
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions doc/release_checklist.md → docs/release_checklist.md
Expand Up @@ -11,15 +11,15 @@ Please see the accompanying [`LICENSE`](../LICENSE) and [`CREDITS`](../CREDITS)
All rights not expressly waived or licensed are reserved.
If those files are missing or appear to be modified from their originals, then please contact the author before viewing or using this software in any capacity.

- [ ] If necessary, update copyright in [`LICENSE`](../LICENSE) and [`doc/conf.py`](../doc/conf.py)
- [ ] If necessary, update copyright in [`LICENSE`](../LICENSE) and [`docs/conf.py`](../docs/conf.py)

- [ ] [`./release.sh`](../release.sh)
- [ ] [`./helpers/release.sh`](../helpers/release.sh)

- [ ] `git push --tags`

- [ ] `python setup.py sdist upload`
- [ ] `python3.x setup.py bdist_wheel sdist && python2.7 setup.py bdist_wheel`

- [ ] Upload `dimgx.egg-info/PKG-INFO` to [`https://pypi.python.org/pypi?:action=submit_form&name=dimgx&version=X.Y.Z`](https://pypi.python.org/pypi?:action=submit_form&name=dimgx&version=X.Y.Z), if necessary (work-around)
- [ ] `twine upload`

- [ ] `git checkout master`

Expand Down
File renamed without changes.
20 changes: 12 additions & 8 deletions release.sh → helpers/release.sh
@@ -1,33 +1,37 @@
#!/usr/bin/env sh
#-*- encoding: utf-8; mode: sh; grammar-ext: sh -*-
# -*- encoding: utf-8; grammar-ext: sh; mode: shell-script -*-

#=========================================================================
# ========================================================================
# Copyright and other protections apply. Please see the accompanying
# ``LICENSE`` and ``CREDITS`` files for rights and restrictions governing
# use of this software. All rights not expressly waived or licensed are
# reserved. If those files are missing or appear to be modified from their
# originals, then please contact the author before viewing or using this
# software in any capacity.
#=========================================================================
# ========================================================================

_REPO_DIR="$( cd "$( dirname "${0}" )" && pwd )/.."
set -ex
[ -d "${_REPO_DIR}" ]
[ "${_REPO_DIR}/helpers/release.sh" -ef "${0}" ]
cd "${_REPO_DIR}"

if [ "${#}" -ne 3 ] ; then
echo 1>&2 "usage: $( basename "${0}" ) MAJOR MINOR PATCH"

exit 1
fi

_MY_DIR="$( cd "$( dirname "${0}" )" && pwd )"
_PKG='dimgx'
PKG="$( python -c 'import setup ; print(setup.SETUP_ARGS["name"])' )"
MAJOR="${1}"
MINOR="${2}"
PATCH="${3}"
VERS="${MAJOR}.${MINOR}.${PATCH}"
TAG="v${VERS}"

set -ex
cd "${_MY_DIR}"
git checkout -b "${VERS}-release"
perl -pi -e 's{^__version__\s*=\s*\(\s*0,\s*0,\s*0\s*\)$}{__version__ = ( '"${MAJOR}"', '"${MINOR}"', '"${PATCH}"' )}g ;' "_${_PKG}/version.py"
perl -pi -e 's{master}{'"${TAG}"'}g ; s{pypi/([^/]+/)'"${_PKG}"'(\.svg)?$}{pypi/\1'"${_PKG}"'/'"${VERS}"'\2}g' README.rst
perl -pi -e 's{^__version__\s*=\s*\(\s*0,\s*0,\s*0\s*\)$}{__version__ = ( '"${MAJOR}"', '"${MINOR}"', '"${PATCH}"' )}g ;' "${PKG}/version.py"
perl -pi -e 's{master}{'"${TAG}"'}g ; s{pypi/([^/]+/)'"${PKG}"'(\.svg)?$}{pypi/\1'"${PKG}"'/'"${VERS}"'\2}g' README.rst
git commit --all --message "Update version and release ${TAG}."
git tag --sign --force --message "Release ${TAG}." "${TAG}"
6 changes: 3 additions & 3 deletions runtests.sh → helpers/runtests.sh
@@ -1,14 +1,14 @@
#!/usr/bin/env sh
#-*- encoding: utf-8; mode: sh; grammar-ext: sh -*-
# -*- encoding: utf-8; grammar-ext: sh; mode: shell-script -*-

#=========================================================================
# ========================================================================
# Copyright and other protections apply. Please see the accompanying
# ``LICENSE`` and ``CREDITS`` files for rights and restrictions governing
# use of this software. All rights not expressly waived or licensed are
# reserved. If those files are missing or appear to be modified from their
# originals, then please contact the author before viewing or using this
# software in any capacity.
#=========================================================================
# ========================================================================

_MY_DIR="$( cd "$( dirname "${0}" )" && pwd )"
set -ex
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
@@ -1,3 +1,5 @@
# -*- encoding: utf-8; mode: ini -*-

# ========================================================================
# Copyright and other protections apply. Please see the accompanying
# ``LICENSE`` and ``CREDITS`` files for rights and restrictions governing
Expand Down
12 changes: 9 additions & 3 deletions setup.py
Expand Up @@ -50,11 +50,15 @@
'python-dateutil',
)

TESTS_REQUIRE = [
'pytest',
]

# WARNING: This imposes limitations on test/requirements.txt such that the
# full Pip syntax is not supported. See also
# <http://stackoverflow.com/questions/14399534/>.
with open(ospath_join(_MY_DIR, 'test', 'requirements.txt')) as f:
TESTS_REQUIRE = f.read().splitlines()
TESTS_REQUIRE.extend(f.read().splitlines())

# ---- Initialization ----------------------------------------------------

Expand All @@ -72,7 +76,7 @@
__vers_str__ = _namespace.get('__vers_str__')
__release__ = _namespace.get('__release__', __vers_str__)

_SETUP_ARGS = {
SETUP_ARGS = {
'name': 'dimgx',
'version': __vers_str__,
'author': 'Matt Bogosian',
Expand All @@ -94,6 +98,8 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: System :: Archiving :: Packaging',
Expand All @@ -116,4 +122,4 @@

if __name__ == '__main__':
environ['COVERAGE_PROCESS_START'] = environ.get('COVERAGE_PROCESS_START', ospath_join(_MY_DIR, '.coveragerc'))
setup(**_SETUP_ARGS)
setup(**SETUP_ARGS)
1 change: 0 additions & 1 deletion test/requirements.txt
@@ -1 +0,0 @@
pytest

0 comments on commit 2f025b2

Please sign in to comment.