diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..38fb427 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitignore b/.gitignore index 894a44c..1996b35 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python +env/ build/ develop-eggs/ dist/ @@ -89,6 +90,8 @@ venv/ ENV/ env.bak/ venv.bak/ +.venv +ENV/ # Spyder project settings .spyderproject diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..dda56e1 --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..a827124 --- /dev/null +++ b/MANIFEST.in @@ -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 diff --git a/pyorg/__init__.py b/pyorg/__init__.py new file mode 100644 index 0000000..0904fa8 --- /dev/null +++ b/pyorg/__init__.py @@ -0,0 +1,8 @@ +"""Root package for pyorg. + +Package for woring with Emacs org-mode files +""" + +__author__ = 'Jared Lumpe' +__email__ = 'mjlumpe@gmail.com' +__version__ = '0.1' diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..7a27b51 --- /dev/null +++ b/setup.cfg @@ -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 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ab49fa5 --- /dev/null +++ b/setup.py @@ -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='mjlumpe@gmail.com', + 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=[], +)