Skip to content

Commit

Permalink
Merge pull request #62 from scottwernervt/60/pre-commit-hooks
Browse files Browse the repository at this point in the history
Add pre-commit hooks and refactor dev and test environments
  • Loading branch information
scottwernervt committed Apr 21, 2020
2 parents b2737d1 + 044c4c0 commit e1f2a55
Show file tree
Hide file tree
Showing 36 changed files with 2,127 additions and 1,718 deletions.
14 changes: 14 additions & 0 deletions .flake8
@@ -0,0 +1,14 @@
[flake8]
max-line-length = 80
max-complexity = 18
select = C,E,F,W,B,B950
ignore = E203,E501,W503
exclude =
.git
.eggs
.tox
__pycache__
docs/conf.py
old
build
dist
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/python/black
rev: 19.10b0
hooks:
- id: black
language_version: python3
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==20.1.4"]
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -15,14 +15,14 @@ script:
jobs:
fast_finish: true

include:
- { name: 'check', python: '3.7', env: TOXENV=check }
- { name: 'docs', python: '3.7', env: TOXENV=docs }
- { name: 'lint', python: '3.7', env: TOXENV=lint }
- { name: 'py35', python: '3.5', env: TOXENV=py35 }
- { name: 'py36', python: '3.6', env: TOXENV=py36 }
- { name: 'py37', python: '3.7', env: TOXENV=py37 }
- { name: 'py38', python: '3.8', env: TOXENV=py38 }
- { name: 'docs', python: '3.7', env: TOXENV=docs }

after_failure:
- more .tox/log/* | cat
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -3,6 +3,14 @@
Changelog
---------

1.0.0 (Unreleased)
+++++++++++++++++++

Features

* Start following (`Semantic Versioning <https://semver.org/>`_).


0.10.1 (2020-04-20)
+++++++++++++++++++

Expand Down
49 changes: 35 additions & 14 deletions CONTRIBUTING.rst
Expand Up @@ -17,8 +17,8 @@ When `reporting a bug <https://github.com/scottwernervt/cloudstorage/issues>`_ p
Documentation improvements
==========================

cloudstorage could always use more documentation, whether as part of the
official cloudstorage docs, in docstrings, or even on the web in blog posts,
``cloudstorage`` could always use more documentation, whether as part of the
official ``cloudstorage`` docs, in docstrings, or even on the web in blog posts,
articles, and such.

Feature requests and feedback
Expand All @@ -38,27 +38,48 @@ Development
To set up `cloudstorage` for local development:

1. `Fork cloudstorage on GitHub <https://github.com/scottwernervt/cloudstorage/fork>`_.
2. Clone your fork locally::

git clone git@github.com:your_name_here/cloudstorage.git
2. Clone your fork locally

3. Create a branch for local development::
::

git checkout -b name-of-your-bugfix-or-feature
$ git clone git@github.com:your_name_here/cloudstorage.git

Now you can make your changes locally.
3. Install development requirements. It is **highly recommended** that you use a ``virtualenv``. Use the following command to install an editable version of marshmallow along with its development requirements.

4. When you're done making changes, run all the checks, and doc builder with `tox <http://tox.readthedocs.io/en/latest/install.html>`_ one command::
::

tox
# After activating your virtualenv
$ pip install -e '.[dev]'

5. Commit your changes and push your branch to GitHub::
4. Install the ``pre-commit`` hooks, which will format and lint your git staged files.

git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature
::

6. Submit a pull request through the GitHub website.
# The pre-commit CLI was installed above
$ pre-commit install --allow-missing-config

5. Create a branch for local development

::

$ git checkout -b name-of-your-bugfix-or-feature

6. When you're done making changes, run all the checks, and doc builder with `tox <http://tox.readthedocs.io/en/latest/install.html>`_ one command

::

$ tox

7. Commit your changes and push your branch to GitHub

::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature

8. Submit a pull request through the GitHub website.

Pull Request Guidelines
-----------------------
Expand Down
23 changes: 17 additions & 6 deletions MANIFEST.in
@@ -1,13 +1,24 @@
graft docs
graft src
graft tests

include *.enc
include *.rst
include *.yaml
include AUTHORS.rst
include CHANGELOG.rst
include CONTRIBUTING.rst
include LICENSE
include README.rst

include tox.ini .travis.yml
recursive-include docs *.bat
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include tests *.png
recursive-include tests *.py
recursive-include tests *.txt

recursive-exclude docs *.pyc
recursive-exclude docs *.pyo
recursive-exclude tests *.pyc
recursive-exclude tests *.pyo

global-exclude *.py[cod] __pycache__ *.so *.dylib *.enc
prune dist/docs
54 changes: 27 additions & 27 deletions docs/conf.py
Expand Up @@ -2,46 +2,46 @@
import os

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.coverage",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.ifconfig",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
]

pygments_style = 'trac'
templates_path = ['.']
source_suffix = '.rst'
master_doc = 'index'
pygments_style = "trac"
templates_path = ["."]
source_suffix = ".rst"
master_doc = "index"

project = 'Cloud Storage'
copyright = 'Copyright 2017-2018 Scott Werner'
author = 'Scott Werner'
version = release = '0.10.1'
project = "Cloud Storage"
copyright = "Copyright 2017-2018 Scott Werner"
author = "Scott Werner"
version = release = "0.10.1"

# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if not on_rtd: # only set the theme if we're building docs locally
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

html_use_smartypants = True
html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = "%b %d, %Y"
html_split_index = False
html_short_title = '%s-%s' % (project, version)
html_short_title = "%s-%s" % (project, version)
html_theme_options = {
'collapse_navigation': False,
'display_version': True,
'navigation_depth': 4,
"collapse_navigation": False,
"display_version": True,
"navigation_depth": 4,
}

# Extensions
autodoc_member_order = 'groupwise'
autodoc_member_order = "groupwise"
intersphinx_mapping = {
'python': ('http://python.readthedocs.io/en/latest/', None),
"python": ("http://python.readthedocs.io/en/latest/", None),
}
todo_include_todos = True
5 changes: 1 addition & 4 deletions docs/requirements.txt
@@ -1,4 +1 @@
sphinx>=1.3
sphinx-rtd-theme
sphinx_autodoc_typehints>=1.10.3
-e .[amazon,google,local,microsoft,minio,rackspace]
-e .[docs,amazon,google,local,microsoft,minio,rackspace]
27 changes: 27 additions & 0 deletions pyproject.toml
@@ -0,0 +1,27 @@
[tool.black]
line-length = 88
target-version = ["py35", "py36", "py37", "py38"]
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''

[tool.check-manifest]
ignore = [
".flake8",
".pre-commit-config.yaml",
".travis.yml",
"pyproject.toml",
"tox.ini",
]

0 comments on commit e1f2a55

Please sign in to comment.