Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimpkins committed Sep 1, 2017
0 parents commit ef6bd62
Show file tree
Hide file tree
Showing 23 changed files with 332 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints

# PyCharm files
.idea/

# Project files
tests/runner.py
tests/profiler.py

# OS X
.DS_Store
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Config file for automatic testing at travis-ci.org

sudo: false
language: python
matrix:
include:
- python: 2.7
env: TOX_ENV=py27
- python: 2.7
env: TOX_ENV=py34
- python: 3.5
env: TOX_ENV=py35
- python: 3.6
env: TOX_ENV=py36

script: tox -e $TOX_ENV

install:
- pip install tox

notifications:
email: false
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Changelog


2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include docs/LICENSE
include docs/README.rst
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## font-v
24 changes: 24 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
build: false
environment:
matrix:
- TOXENV: py27
- TOXENV: py34
- TOXENV: py35
- TOXENV: py36
platform:
- x86
- x64
init:
- "ECHO %TOXENV%"
- ps: "ls C:\\Python*"
install:
- ps: Invoke-WebRequest "https://bootstrap.pypa.io/ez_setup.py" -OutFile "c:\\ez_setup.py"
- ps: Invoke-WebRequest "https://bootstrap.pypa.io/get-pip.py" -OutFile "c:\\get-pip.py"
- "c:\\python27\\python c:\\ez_setup.py"
- "c:\\python27\\python c:\\get-pip.py"
- "c:\\python27\\Scripts\\pip install tox"
test_script:
- "git clean -f -d -x"
- "c:\\python27\\Scripts\\tox --version"
- "c:\\python27\\Scripts\\pip --version"
- "c:\\python27\\Scripts\\tox"
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
codecov:
max_report_age: off
8 changes: 8 additions & 0 deletions coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

coverage run --source font-v -m py.test
coverage report -m
coverage html

#coverage xml
#codecov --token=$CODECOV_{{font-v}}
20 changes: 20 additions & 0 deletions docs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2017 Christopher Simpkins

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8 changes: 8 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
font-v
========

A font version string tool.

Source and documentation: https://github.com/source-foundry/font-v
Issue reporting: https://github.com/source-foundry/font-v/issues
License: MIT
Empty file added lib/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions lib/fontv/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

30 changes: 30 additions & 0 deletions lib/fontv/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

from commandlines import Command

from fontv import settings


def main():
c = Command()

if c.does_not_validate_missing_args():
sys.stderr.write("[font-v] ERROR: Please include the appropriate arguments with your command." + os.linesep)
sys.exit(1)

if c.is_help_request():
print(settings.HELP)
sys.exit(0)
elif c.is_version_request():
print(settings.VERSION)
sys.exit(0)
elif c.is_usage_request():
print(settings.USAGE)
sys.exit(0)

if __name__ == '__main__':
main()
2 changes: 2 additions & 0 deletions lib/fontv/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
37 changes: 37 additions & 0 deletions lib/fontv/settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# ------------------------------------------------------------------------------
# Library Name
# ------------------------------------------------------------------------------
lib_name = 'font-v'

# ------------------------------------------------------------------------------
# Version Number
# ------------------------------------------------------------------------------
major_version = "0"
minor_version = "0"
patch_version = "1"

# ------------------------------------------------------------------------------
# Help String
# ------------------------------------------------------------------------------

HELP = """
***
"""

# ------------------------------------------------------------------------------
# Version String
# ------------------------------------------------------------------------------

VERSION = "font-v v" + major_version + "." + minor_version + "." + patch_version


# ------------------------------------------------------------------------------
# Usage String
# ------------------------------------------------------------------------------

USAGE = """
***
"""
4 changes: 4 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

python3 setup.py sdist bdist_wheel
twine upload dist/font-v-0.1.0*
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
commandlines
gitpython
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[wheel]
universal = 1
63 changes: 63 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import os
import re
from setuptools import setup, find_packages


def docs_read(fname):
return open(os.path.join(os.path.dirname(__file__), 'docs', fname)).read()


def version_read():
settings_file = open(os.path.join(os.path.dirname(__file__), 'lib', 'fontv', 'settings.py')).read()
major_regex = """major_version\s*?=\s*?["']{1}(\d+)["']{1}"""
minor_regex = """minor_version\s*?=\s*?["']{1}(\d+)["']{1}"""
patch_regex = """patch_version\s*?=\s*?["']{1}(\d+)["']{1}"""
major_match = re.search(major_regex, settings_file)
minor_match = re.search(minor_regex, settings_file)
patch_match = re.search(patch_regex, settings_file)
major_version = major_match.group(1)
minor_version = minor_match.group(1)
patch_version = patch_match.group(1)
if len(major_version) == 0:
major_version = 0
if len(minor_version) == 0:
minor_version = 0
if len(patch_version) == 0:
patch_version = 0
return major_version + "." + minor_version + "." + patch_version


setup(
name='font-v',
version=version_read(),
description='Font version string tool',
long_description=(docs_read('README.rst')),
url='https://github.com/source-foundry/font-v',
license='MIT license',
author='Christopher Simpkins',
author_email='chris@sourcefoundry.org',
platforms=['any'],
packages=find_packages("lib"),
package_dir={'': 'lib'},
install_requires=['commandlines', 'gitpython'],
entry_points={
'console_scripts': [
'font-v = fontv.app:main'
],
},
keywords='',
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'Natural Language :: English',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
)
5 changes: 5 additions & 0 deletions test_runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

# test_runner.sh : local testing script

tox -e py27,py36
Empty file added tests/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import pytest
18 changes: 18 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tox]
envlist = py27, py34, py35, py36

[testenv]
passenv = TOXENV CI TRAVIS TRAVIS_*
commands =
py.test tests

deps =
pytest
pytest-mock
mock
coverage
codecov>=1.4.0


;[testenv:cov-report]
;commands = py.test --cov=ufolint --cov-report=term --cov-report=html

0 comments on commit ef6bd62

Please sign in to comment.