Skip to content

Commit

Permalink
Merge pull request #77 from geometalab/VersioneerChanges
Browse files Browse the repository at this point in the history
Versioneer changes
  • Loading branch information
marcelhuberfoo authored Jun 20, 2016
2 parents 399a01d + 28f5dc0 commit 5c5938c
Show file tree
Hide file tree
Showing 9 changed files with 2,296 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/_version.py export-subst
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include src/_version.py
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ The following steps are required if you want to checkout directly into your envi
To test if your installation is working, run at least the tests like this:

```
python (MAPQUEST_API_KEY="Your API Key Here" python -m nose \
--with-xunit --with-coverage --cover-package=src)
MAPQUEST_API_KEY="Your API Key Here" python -m nose \
--with-xunit --with-coverage --cover-package=src
```
You can also execute `main.py` and check its options or the options of the subcommands. Please note that it is required to add the current path to the `PYTHONPATH` environment variable.
```
Expand Down
3 changes: 1 addition & 2 deletions docker/crosswalks/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ RUN echo "repo URL:[$GIT_REPO_URL] branch:[$GIT_BRANCH]"
RUN cd /root \
&& git clone --single-branch --branch $GIT_BRANCH --depth 1 $GIT_REPO_URL \
&& cd OSM-Crosswalk-Detection \
&& python setup.py install \
&& touch DockerIam
&& python setup.py install

# store results in this directory
ENV OUTPUT_DIR=/output
Expand Down
8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ with-coverage = true
cover-package = src

[easy_install]

[versioneer]
VCS = git
style = pep440
versionfile_source = src/_version.py
versionfile_build = src/_version.py
tag_prefix =
parentdir_prefix = crosswalks-
27 changes: 10 additions & 17 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import codecs
import re
import versioneer
from setuptools import setup
from pip.req import parse_requirements

package = 'src'


here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, package, '__init__.py'),
encoding='utf8') as version_file:
metadata = dict(
re.findall(
r"""__([a-z]+)__ = "([^"]+)""",
version_file.read()))
PACKAGE = 'src'


def get_packages(package):
"""
Return root package and all sub-packages.
"""
"""Return root package and all sub-packages."""
return [dirpath
for dirpath, _, _ in os.walk(package)
if os.path.exists(os.path.join(dirpath, '__init__.py'))]
Expand All @@ -41,15 +32,17 @@ def get_requirements():

setup(
name="OSM-Crosswalk-Detection",
version=metadata['version'],
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author="Buehler Severin and Kurath Samuel",
author_email="[email protected], [email protected]",
maintainer="Marcel Huber",
maintainer_email="[email protected]",
description="Crosswalk detection on orthofotos.",
license="MIT",
keywords=['crosswalk detection'],
url="https://github.com/geometalab/OSM-Crosswalk-Detection",
packages=get_packages(package),
packages=get_packages(PACKAGE),
install_requires=get_requirements(),
setup_requires=[],
test_suite='tests',
Expand Down
5 changes: 3 additions & 2 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import environ
import os

__version__ = "0.1.4.dev"
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

root = environ.Path(os.getcwd())
cwenv = environ.Env(
Expand All @@ -28,4 +30,3 @@
'.'),
)
environ.Env.read_env(root('.env')) # reading .env file

Loading

0 comments on commit 5c5938c

Please sign in to comment.