Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooling #21

Merged
merged 9 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = RIMEz
# omit = bad_file.py

[paths]
source =
src/
*/site-packages/

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E203, E266, E501, W503, F403, F401
max-line-length = 88
max-complexity = 18
select = B,C,E,F,W,T4,B9
53 changes: 50 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,51 @@
*.pyc
# Temporary and binary files
*~
*.py[cod]
*.so
*.cfg
!.isort.cfg
!setup.cfg
*.orig
*.log
*.pot
__pycache__/*
.cache/*
.*.swp
*/.ipynb_checkpoints/*
.DS_Store

# Project files
.ropeproject
.project
.pydevproject
.settings
.idea
tags

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info
pip-wheel-metadata
.eggs/
pip-wheel-metadata/

# Unittest and coverage
htmlcov/*
.coverage
.tox
junit.xml
coverage.xml
.pytest_cache/

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/api/*
docs/_rst/*
docs/_build/*
cover/*
MANIFEST

# Per-project virtualenvs
.venv*/
10 changes: 10 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
line_length=88
indent=' '
skip=.tox,.venv,build,dist
known_standard_library=setuptools,pkg_resources
known_test=pytest
known_first_party=RIMEz
sections=FUTURE,STDLIB,COMPAT,TEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section=THIRDPARTY
multi_line_output=3
45 changes: 41 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
exclude: '^docs/conf.py'

repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.2.3
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-ast
- id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=no']
- id: flake8
additional_dependencies:
- flake8-quotes
- flake8-comprehensions
- flake8-black
- flake8-builtins
- flake8-eradicate
- pep8-naming
- flake8-isort
- flake8-pytest
- flake8-docstrings
- flake8-rst-docstrings
- flake8-rst
- darglint
- flake8-copyright
- flake8-ownership
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.4
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
39 changes: 39 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Travis configuration file using the build matrix feature
# Read more under http://docs.travis-ci.com/user/build-configuration/
# THIS SCRIPT IS SUPPOSED TO BE AN EXAMPLE. MODIFY IT ACCORDING TO YOUR NEEDS!

sudo: false
language: python
virtualenv:
system_site_packages: false
matrix:
fast_finish: true
include:
- python: 3.6
env: DISTRIB="ubuntu" TOX_PYTHON_VERSION="py36" COVERAGE="true"
- env: DISTRIB="conda" PYTHON_VERSION="3.6" COVERAGE="false"
install:
- source tests/travis_install.sh
- pip install -r requirements.txt
# ^ DEPRECATION WARNING:
# The automatic creation of a `requirements.txt` file is deprecated.
# See `Dependency Management` in the docs for other options.
before_script:
- git config --global user.email "[email protected]"
- git config --global user.name "Your Name"
script:
- python setup.py develop
- tox
- |
if [[ "$COVERAGE" == "true" ]]; then
pre-commit install
pre-commit run --all-files
fi
after_success:
- if [[ "$COVERAGE" == "true" ]]; then coveralls || echo "failed"; fi
after_script:
- travis-cleanup
cache:
pip: true
directories:
- $HOME/miniconda
7 changes: 7 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
============
Contributors
============

* Zachary Martinot <[email protected]>
* Paul La Plante <[email protected]>
* Steven Murray <[email protected]>
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
=========
Changelog
=========

Unreleased
==========

Added
~~~~~
* Multiple package tooling updates.


Version 0.1.1
=============
Easily installable version.
41 changes: 39 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ using the environment variable ``FFTW_PATH``, which should be the path to the

$ FFTW_PATH=/usr/lib pip install .


User Install
------------
If you just want to install ``RIMEz`` for general use, install with::
Expand All @@ -60,4 +59,42 @@ Developer Install
If you are developing ``RIMEz``, clone the repo, install the dependencies as
above, and then do (in the repo)::

$ pip install -e .[dev]
$ pip install -e ".[all,dev]"


Optional Extras
---------------
There are a number of optional extras that can be installed along with ``RIMEz``,
including ``gsm`` (which permits using the GSM as a sky model). To use all (user-focused)
optional extras, install with ``pip install ".[all]"``, otherwise you can pick and
choose by using a comma-separated list in the square brackets.

There are also a number of development-related groups of optional extras. If you are
developing, we recommend using *all* of them by installing the ``dev`` extra
(as specified above).

Development
===========
To install ``RIMEz`` for development, see above.
We *strongly* recommend installing the provided pre-commit hooks the first time you
clone the repo::

$ pre-commit install

This will allow linting checks (and auto-fixes!) to be performed automatically
whenever you commit.

Testing
-------
To run tests locally, use ``tox``. This is preferred over using ``pytest`` directly
because it also tests the package installation and setup. You can run a single
tox environment by using ``tox -e ENVNAME``. In particular, to run the linting
checks, use ``tox -e lint`` (however, these exact checks will be run when you commit,
if you have installed the pre-commit hooks, as above).

Versioning
----------
We use ``setuptools_scm`` for versioning the code. To create a new version, we recommend
creating a new dedicated branch to bump the version. On this branch, update the
``CHANGELOG.rst``, and make a commit with an associated git tag with the format
``vMAJOR.MINOR.PATCH``. Once merged into master, the new version will be active.
17 changes: 0 additions & 17 deletions RIMEz/__init__.py

This file was deleted.

Loading