Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
Updating some helper files again.
Browse files Browse the repository at this point in the history
More changes since spending time on sphinxconfig-imgur these past couple
of months.

Fixing buildign docs on Windows by not executing setup.py (Windows
doesn't execute scripts). Importing instead.

Fixing linting on Windows (handling \r\n line endings in regex).
  • Loading branch information
Robpol86 committed Oct 16, 2016
1 parent 3fa1997 commit 286ec1e
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 51 deletions.
37 changes: 32 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ var/
*.egg-info/
.installed.cfg
*.egg
*.rpm
requirements*.txt

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down Expand Up @@ -53,17 +51,46 @@ coverage.xml

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
# IPython Notebook
.ipynb_checkpoints

# IntelliJ
.idea/
# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Robpol86
test*.png
*.rpm
.idea/
requirements*.txt
.DS_Store
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pip install tox # Install tox, which runs linting and tests.
tox # This runs all tests on your local machine. Make sure they pass.
```

If you don't have Python 2.6, 2.7, and 3.4 installed, you can manually run tests on one specific version by running
`tox -e lint,py27` (for Python 2.7) instead.
If you don't have Python 2.6, 2.7, or 3.4 installed you can manually run tests on one specific version by running
`tox -e lint,py35` (for Python 3.5) instead.

## Updating Docs

Expand Down
12 changes: 6 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
"""Sphinx configuration file."""

import os
import sys
import time
from subprocess import check_output

SETUP = os.path.join(os.path.dirname(__file__), '..', 'setup.py')


# General configuration.
author = check_output([SETUP, '--author']).strip().decode('ascii')
sys.path.append(os.path.realpath(os.path.join(os.path.dirname(__file__), '..')))
author = '@Robpol86'
copyright = '{}, {}'.format(time.strftime('%Y'), author)
master_doc = 'index'
project = check_output([SETUP, '--name']).strip().decode('ascii')
project = __import__('setup').NAME
pygments_style = 'friendly'
release = version = check_output([SETUP, '--version']).strip().decode('ascii')
release = version = __import__('setup').VERSION
templates_path = ['_templates']
extensions = list()

Expand Down Expand Up @@ -46,6 +45,7 @@
extensions.append('sphinxcontrib.googleanalytics')
googleanalytics_id = 'UA-82627369-1'


# SCVersioning.
scv_banner_greatest_tag = True
scv_grm_exclude = ('.gitignore', '.nojekyll', 'README.rst')
Expand Down
78 changes: 40 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,51 +59,53 @@ def run(cls):
if getattr(project, var) != expected:
raise SystemExit('Mismatch: {0}'.format(var))
# Check changelog.
if not re.compile(r'^%s - \d{4}-\d{2}-\d{2}$' % VERSION, re.MULTILINE).search(readme()):
if not re.compile(r'^%s - \d{4}-\d{2}-\d{2}[\r\n]' % VERSION, re.MULTILINE).search(readme()):
raise SystemExit('Version not found in readme/changelog file.')
# Check tox.
if INSTALL_REQUIRES:
section = re.compile(r'\ninstall_requires =\n(.+?)\n\w', re.DOTALL).findall(readme('tox.ini'))
contents = readme('tox.ini')
section = re.compile(r'[\r\n]+install_requires =[\r\n]+(.+?)[\r\n]+\w', re.DOTALL).findall(contents)
if not section:
raise SystemExit('Missing install_requires section in tox.ini.')
in_tox = re.findall(r' ([^=]+)==[\w\d.-]+', section[0])
if INSTALL_REQUIRES != in_tox:
raise SystemExit('Missing/unordered pinned dependencies in tox.ini.')


setup(
author='@Robpol86',
author_email='[email protected]',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: MacOS X',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries',
'Topic :: Terminals',
'Topic :: Text Processing :: Markup',
],
cmdclass=dict(check_version=CheckVersion),
description='Generate simple tables in terminals from a nested list of strings.',
install_requires=INSTALL_REQUIRES,
keywords='Shell Bash ANSI ASCII terminal tables',
license=LICENSE,
long_description=readme(),
name=NAME,
packages=[IMPORT],
url='https://github.com/Robpol86/' + NAME,
version=VERSION,
zip_safe=True,
)
if __name__ == '__main__':
setup(
author='@Robpol86',
author_email='[email protected]',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: MacOS X',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries',
'Topic :: Terminals',
'Topic :: Text Processing :: Markup',
],
cmdclass=dict(check_version=CheckVersion),
description='Generate simple tables in terminals from a nested list of strings.',
install_requires=INSTALL_REQUIRES,
keywords='Shell Bash ANSI ASCII terminal tables',
license=LICENSE,
long_description=readme(),
name=NAME,
packages=[IMPORT],
url='https://github.com/Robpol86/' + NAME,
version=VERSION,
zip_safe=True,
)

0 comments on commit 286ec1e

Please sign in to comment.