Skip to content

Commit

Permalink
Development environment changes
Browse files Browse the repository at this point in the history
- Added some sparse docs about testing with tox and pyenv.
- Update pre-commit revisions settings to 'rev' (was 'sha') both in the docs
  for ksconf users as in our pre-commit configuration used by ksconf developers.
- Enable Python 3.8 testing and removed 3.5 for Windows testing (Appveyor).
  Revamped lists of Python version numbers for Travis, Appveyor, and for local
  testing mode in vagrant/docker (many upstream SSL enforcement changes made it
  necessary jump to higher patch versions)
  • Loading branch information
lowell80 committed Mar 5, 2020
1 parent ab80fa5 commit b4187a4
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See http://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: v2.0.0
rev: v2.0.0
hooks:
- id: trailing-whitespace
exclude: (cli\.rst|\.md|\.csv)$
Expand Down Expand Up @@ -34,11 +34,11 @@ repos:

# Way too much noise.... (or I just have bad code, either way it's too much)
#- repo: https://github.com/pre-commit/mirrors-pylint
# sha: master
# rev: master
# hooks:
# - id: pylint

#- repo: https://github.com/jorisroovers/gitlint
# sha: master
# rev: master
# hooks:
# - id: gitlint
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ matrix:
python: '3.7'
dist: xenial
sudo: true
- os: linux
python: '3.8'
dist: xenial
sudo: true
- os: osx
language: objective-c
env: PYENV_VERSION=2.7.17
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN git clone https://github.com/magicmonty/bash-git-prompt.git ~/.bash-git-prom
&& echo 'GIT_PROMPT_ONLY_IN_REPO=1' >> ~/.bashrc \
&& echo 'source ~/.bash-git-prompt/gitprompt.sh' >> ~/.bashrc

ENV PYVERS="2.7.15 3.7.1 3.6.7 3.5.6 3.4.9 pypy2.7-6.0.0"
ENV PYVERS="2.7.17 3.8.1 3.7.6 3.6.10 3.5.9 3.4.9 pypy2.7-6.0.0"

RUN for i in ${PYVERS}; do \
~/.pyenv/bin/pyenv install ${i}; \
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Vagrant.configure("2") do |config|
eval "$(pyenv init -)"
# Keep python versions in just one list to reduce number of edits and typos ;-)
PYVERS="2.7.15 3.7.1 3.6.7 3.5.6 3.4.9 pypy2.7-6.0.0"
PYVERS="2.7.17 3.8.1 3.7.6 3.6.10 3.5.9 3.4.9 pypy2.7-6.0.0"
for ver in $PYVERS
do
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ environment:
matrix:
- PYTHON: "C:\\Python27"
- PYTHON: "C:\\Python27-x64"
- PYTHON: "C:\\Python35"
- PYTHON: "C:\\Python35-x64"
- PYTHON: "C:\\Python36"
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37"
- PYTHON: "C:\\Python37-x64"
- PYTHON: "C:\\Python38"
- PYTHON: "C:\\Python38-x64"

# scripts that are called at very beginning, before repo cloning
init:
Expand Down
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Release v0.7.7 (DRAFT)
- Fixed issues with the ``unarchive`` command when ``git`` is not installed or an app is being unarchived (installed/upgrade) into a location not managed by Git. Note that additional output is now enabled when the ``KSCONF_DEBUG`` environmental variable is set (in liue of a proper verbose mode). Bug report provided by SID800.
- Enhanced ``ksconf --version`` output to include Git executable path and version information; as well as a platform dump. (Helpful for future bug reporting.)
- Add feature to disable the marker file (safety check) automatically created by the ``combine`` command for use in automated processing workflows.
- Updated ``pre-commit`` documentation and sample configurations to use ``rev`` rather than ``sha`` as the means of identifying upstream tags or revisions. Recent releases of ``pre-commit`` will warn you about this during each run.

Release v0.7.6 (2019-08-15)
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
5 changes: 4 additions & 1 deletion docs/source/common
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
.. _gitlint: https://jorisroovers.github.io/gitlint/
.. _kintyre-splunk-conf-wheel: https://pypi.org/project/kintyre-splunk-conf/#files
.. _kintyre-splunk-conf: https://pypi.org/project/kintyre-splunk-conf
.. _ksconf repo: https://github.com/Kintyre/ksconf
.. _ksconf app for splunk: https://splunkbase.splunk.com/app/4383/
.. _ksconf repo: https://github.com/Kintyre/ksconf
.. _pre-commit: https://pre-commit.com/
.. _pyenv: https://github.com/pyenv/pyenv
.. _python: https://www.python.org/downloads/
.. _tox: https://tox.readthedocs.io/en/latest/
.. _virtualenv: https://virtualenv.pypa.io/en/stable/


.. vim:ft=rst:
28 changes: 28 additions & 0 deletions docs/source/devel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,32 @@ the following (for building docs, etc.):
brew install homebrew/cask/mactex-no-gui
Running TOX
-----------

Local testing across multiple versions of python can be accomplished with tox_ and pyenv_.
See the online docs for theses tools for more details.

Tox and pyenv can be run like so:

.. code-block:: sh
# Install the necessary python versions
pyenv install 2.7.17
...
pyenv install 3.8.1
# Set specific default version of python for each major/minor release (tab completion is your friend here)
pyenv local 2.7.17 ... 3.8.1
# Run tox for ALL python versions
tox
# Run tox for just a specific python version
tox -e py38
Some additional information about how to setup and run these tests can be gleaned from the ``Vagrantfile`` and ``Dockerfile``
in the root of the git repository, though specific python versions contained there may be quite out of date.

.. include:: common
10 changes: 5 additions & 5 deletions docs/source/git.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To add ksconf pre-commit hooks to your repository, add the following content to
repos:
- repo: https://github.com/Kintyre/ksconf
sha: v0.7.4
rev: v0.7.7
hooks:
- id: ksconf-check
- id: ksconf-sort
Expand All @@ -64,7 +64,7 @@ For general reference, here's a copy of what we frequently use for our repos.
.. code-block:: yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: v2.0.0
rev: v2.0.0
hooks:
- id: trailing-whitespace
exclude: README.md
Expand All @@ -80,7 +80,7 @@ For general reference, here's a copy of what we frequently use for our repos.
- id: mixed-line-ending
args: [ '--fix=lf' ]
- repo: https://github.com/Kintyre/ksconf
sha: v0.7.4
rev: v0.7.7
hooks:
- id: ksconf-check
- id: ksconf-sort
Expand All @@ -89,7 +89,7 @@ For general reference, here's a copy of what we frequently use for our repos.
.. tip::

You may want to update ``sha`` to the most currently released stable version.
You should update ``rev`` to the most currently released stable version.
Upgrading this frequently isn't typically necessary since these two operations are pretty basic and stable.
However, it's still a good idea to review the change log to see what, if any, pre-commit functionality was updated.

Expand All @@ -115,7 +115,7 @@ Should my version of ksconf and pre-commit plugins be the same?

If you're running both ``ksconf`` locally as well as the ksconf pre-commit plugin, then technically you have ksconf installed twice.
That may sound less than ideal, but practically, this isn't a problem.
As long as the version of the ksconf CLI tool is *close* to the ``sha`` listed in :file:`.pre-commit-config.yaml`, then everything should work fine.
As long as the version of the ksconf CLI tool is *close* to the ``rev`` listed in :file:`.pre-commit-config.yaml`, then everything should work fine.

Our suggestion:

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def get_ver():
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Utilities",
],
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# and then run "tox" from this directory.

[tox]
envlist = py27, py34, py35, py36, py37, pypy
envlist = py27, py34, py35, py36, py37, py38, pypy
skip_missing_interpreters = true

[testenv]
commands = {envpython} setup.py install
Expand Down

0 comments on commit b4187a4

Please sign in to comment.