Skip to content

Commit

Permalink
New package from cookiecutter
Browse files Browse the repository at this point in the history
  • Loading branch information
jlumpe committed Jan 29, 2019
1 parent 5d6d3d0 commit 8129d6b
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# top-most EditorConfig file
root = true

# Match all files...
[*]
end_of_line = lf

# Python files
[*.py]
charset = utf-8
indent_style = tab
tab_width = 4
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -89,6 +90,8 @@ venv/
ENV/
env.bak/
venv.bak/
.venv
ENV/

# Spyder project settings
.spyderproject
Expand Down
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: python
python:
- '3.6'

# Whitelist of branches to build
branches:
only:
- master

# Avoid email notifications on every build
notifications:
email: false

# Installation command
install: python setup.py install

# Run pytest
script: python -m pytest -v
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include README.md
include LICENSE

recursive-include tests *

recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat
8 changes: 8 additions & 0 deletions pyorg/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Root package for pyorg.
Package for woring with Emacs org-mode files
"""

__author__ = 'Jared Lumpe'
__email__ = '[email protected]'
__version__ = '0.1'
34 changes: 34 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Aliases for setuptools commands
[aliases]
test = pytest


# Pytest settings
[tool:pytest]

# Run tests in tests/, obviously
# Also check docstrings in package
testpaths = tests pyorg

# Run doctests on all modules
addopts = --doctest-modules
doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL


# Flake8 settings
[flake8]

# Ignore these codes:
ignore =
# TABS ARE BETTER
W191,
# indentation contains mixed spaces and tabs - spaces for alignment
E101,
# Blank line at end of file - we require this in .editorconfig
W391

# Exclude these paths:
exclude = docs

# Check style of doctests (not working?)
doctests = True
51 changes: 51 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""Setuptools installation script for pyorg package."""

from setuptools import setup
import re


# Get contents of README file
with open('README.md') as fh:
readme_contents = fh.read()


# Read version from root module __init__.py
with open('pyorg/__init__.py') as fh:
init_contents = fh.read()
version_match = re.search('^__version__ = ["\']([^"\']+)["\']', init_contents, re.M)

if not version_match:
raise RuntimeError('Unable to get version string')

version = version_match.group(1)


requirements = [
]

setup_requirements = ['pytest-runner']

test_requirements = ['pytest']


setup(
name='pyorg',
version=version,
description='Package for woring with Emacs org-mode files',
long_description=readme_contents,
author='Jared Lumpe',
author_email='[email protected]',
url='https://github.com/jlumpe/pyorg',
python_requires='>=3.5',
install_requires=requirements,
setup_requires=setup_requirements,
tests_require=test_requirements,
include_package_data=True,
# license='',
# classifiers='',
# keywords=[],
# platforms=[],
# provides=[],
# requires=[],
# obsoletes=[],
)

0 comments on commit 8129d6b

Please sign in to comment.