Skip to content
Snippets Groups Projects
Commit e25ba520 authored by Garrett Bates's avatar Garrett Bates
Browse files

Merge branch 'cleanup' into 'master'

Formatting and cookiecutter files cleanup

See merge request passoft/ckMseed!6
parents 731c59bc 035bddf3
No related branches found
No related tags found
1 merge request!6Formatting and cookiecutter files cleanup
Pipeline #925 passed with stage
in 43 seconds
...@@ -20,6 +20,14 @@ stages: ...@@ -20,6 +20,14 @@ stages:
before_script: before_script:
- pip install -e .[dev] - pip install -e .[dev]
linting:
image: python:3.6
tags:
- passoft
stage: test
script:
- flake8 --ignore=F403,F405,F821,F841,W504 ckMseed
python3.6: python3.6:
image: python:3.6 image: python:3.6
tags: tags:
......
...@@ -45,7 +45,8 @@ articles, and such. ...@@ -45,7 +45,8 @@ articles, and such.
Submit Feedback Submit Feedback
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
The best way to send feedback is to file an issue at https://git.passcal.nmt.edu/passoft/ckmseed/issues. The best way to send feedback is to file an issue at
https://git.passcal.nmt.edu/passoft/ckmseed/issues.
If you are proposing a feature: If you are proposing a feature:
...@@ -59,31 +60,31 @@ Get Started! ...@@ -59,31 +60,31 @@ Get Started!
Ready to contribute? Here's how to set up `ckmseed` for local development. Ready to contribute? Here's how to set up `ckmseed` for local development.
1. Cone the `ckmseed` repo:: 1. Clone the `ckmseed` repo:
$ git clone https://git.passcal.nmt.edu/passoft/ckmseed.git $ git clone https://git.passcal.nmt.edu/passoft/ckmseed.git
3. Install your local copy:: 2. Install your local copy:
$ pip install -e .[dev] $ pip install -e .[dev]
4. Create a branch for local development:: 3. Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature $ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally. Now you can make your changes locally.
5. When you're done making changes, check that your changes pass the 4. When you're done making changes, check that your changes pass the
tests:: tests:
$ python setup.py test $ python setup.py test
6. Commit your changes and push your branch to GitHub:: 5. Commit your changes and push your branch to GitHub:
$ git add . $ git add .
$ git commit -m "Your detailed description of your changes." $ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature $ git push origin name-of-your-bugfix-or-feature
7. Submit a merge request through the Gitlab website. 6. Submit a merge request through the Gitlab website.
Pull Request Guidelines Pull Request Guidelines
----------------------- -----------------------
...@@ -94,13 +95,13 @@ Before you submit a merge request, check that it meets these guidelines: ...@@ -94,13 +95,13 @@ Before you submit a merge request, check that it meets these guidelines:
2. If the merge request adds functionality, the docs should be updated. Put 2. If the merge request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the your new functionality into a function with a docstring, and add the
feature to the list in README.rst. feature to the list in README.rst.
3. The pull request should work for Python 2.7 3. The pull request should work for Python 3.[6,7,8]
Tips Tips
---- ----
To run a subset of tests:: To run a subset of tests::
$ python -m unittest tests.test_ckmseed $ python -m unittest
Deploying Deploying
--------- ---------
...@@ -111,4 +112,3 @@ Then run:: ...@@ -111,4 +112,3 @@ Then run::
$ git push $ git push
$ git push --tags $ git push --tags
...@@ -11,3 +11,18 @@ History ...@@ -11,3 +11,18 @@ History
------------------ ------------------
* 2nd release on new build system. * 2nd release on new build system.
2020.211 (2020-07-29)
------------------
* Removed use of lstrip() in ckMseed.py
* Fixed issue with exec and variable scope in LibTrace.py
(see GetBlk() and PutBlk())
* Updated to work with Python 3
* Added a unit test to test ckMseed import
* Updated list of platform specific dependencies to be installed when pip
installing ckMseed (see setup.py)
* Installed and tested ckMseed against Python3.[6,7,8] using tox
* Formatted Python code to conform to the PEP8 style guide
* Created conda packages for ckMseed that can run on Python3.[6,7,8]
* Updated .gitlab-ci.yml to run a linter and unit tests for Python3.[6,7,8]
in GitLab CI pipeline
...@@ -5,7 +5,5 @@ include LICENSE ...@@ -5,7 +5,5 @@ include LICENSE
include README.rst include README.rst
recursive-include tests * recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif recursive-include docs *.rst conf.py
.PHONY: clean clean-test clean-pyc clean-build docs help
.DEFAULT_GOAL := help
define BROWSER_PYSCRIPT
import os, webbrowser, sys
try:
from urllib import pathname2url
except:
from urllib.request import pathname2url
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
endef
export BROWSER_PYSCRIPT
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
lint: ## check style with flake8
flake8 ckmseed tests
test: ## run tests quickly with the default Python
python setup.py test
test-all: ## run tests on every Python version with tox
tox
coverage: ## check code coverage quickly with the default Python
coverage run --source ckmseed setup.py test
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/ckmseed.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ ckmseed
$(MAKE) -C docs clean
$(MAKE) -C docs html
$(BROWSER) docs/_build/html/index.html
servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
release: dist ## package and upload a release
twine upload dist/*
dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
ls -l dist
install: clean ## install the package to the active Python's site-packages
python setup.py install
...@@ -2,23 +2,11 @@ ...@@ -2,23 +2,11 @@
ckMseed ckMseed
======= =======
* Description: Find and review MSEED files
Find and review MSEED files. * Usage: ckMseed
ckMseed -#
ckMseed -h
ckMseed [-d DataDirs] [-s] [-v] [-V]
* Free software: GNU General Public License v3 (GPLv3) * Free software: GNU General Public License v3 (GPLv3)
Features
--------
* TODO
Credits
-------
This package was created with Cookiecutter_ and the `passoft/cookiecutter`_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`passoft/cookiecutter`: https://git.passcal.nmt.edu/passoft/cookiecutter
This diff is collapsed.
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
__author__ = """IRIS PASSCAL""" __author__ = """IRIS PASSCAL"""
__email__ = 'software-support@passcal.nmt.edu' __email__ = 'software-support@passcal.nmt.edu'
__version__ = '2018.179' __version__ = '2020.211'
This diff is collapsed.
[bumpversion]
current_version = 2018.179
commit = True
tag = True
[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'
[bumpversion:file:ckmseed/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
[bdist_wheel]
universal = 1
[flake8] [flake8]
exclude = docs exclude = docs
[aliases] [aliases]
# Define setup.py command aliases here # Define setup.py command aliases here
...@@ -30,19 +30,12 @@ setup( ...@@ -30,19 +30,12 @@ setup(
'ckmseed=ckMseed.ckMseed:main', 'ckmseed=ckMseed.ckMseed:main',
], ],
}, },
setup_requires = [],
install_requires=['Pmw @ https://github.com/schrodinger/pmw-patched/archive/master.tar.gz'], install_requires=['Pmw @ https://github.com/schrodinger/pmw-patched/archive/master.tar.gz'],
setup_requires=[],
extras_require={ extras_require={
'dev': [ 'dev': [
'pip',
'bumpversion',
'wheel',
'watchdog',
'flake8', 'flake8',
'tox', 'tox',
'coverage',
'Sphinx',
'twine',
] ]
}, },
license="GNU General Public License v3", license="GNU General Public License v3",
...@@ -51,8 +44,7 @@ setup( ...@@ -51,8 +44,7 @@ setup(
keywords='ckmseed', keywords='ckmseed',
name='ckmseed', name='ckmseed',
packages=find_packages(include=['ckMseed']), packages=find_packages(include=['ckMseed']),
test_suite='tests',
url='https://git.passcal.nmt.edu/passoft/ckmseed', url='https://git.passcal.nmt.edu/passoft/ckmseed',
version='2018.179', version='2020.211',
zip_safe=False, zip_safe=False,
) )
[tox] [tox]
envlist = py36, py37, py38 envlist = py36, py37, py38, flake8
[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 --ignore=F403,F405,F821,F841,W504 ckMseed
[testenv] [testenv]
commands = python -m unittest commands = python -m unittest
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment