Skip to content

Commit 8512ad2

Browse files
committed
Refactor as pip-compatiable package
1 parent 1d83377 commit 8512ad2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1405
-937
lines changed

AUTHORS.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Development Lead
6+
----------------
7+
8+
* Tim Parker <tim.parkerd@gmail.com>
9+
10+
Contributors
11+
------------
12+
13+
None yet. Why not be the first?

CHANGELOG.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

CONTRIBUTING.rst

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
.. highlight:: shell
2+
3+
============
4+
Contributing
5+
============
6+
7+
Contributions are welcome, and they are greatly appreciated! Every little bit
8+
helps, and credit will always be given.
9+
10+
You can contribute in many ways:
11+
12+
Types of Contributions
13+
----------------------
14+
15+
Report Bugs
16+
~~~~~~~~~~~
17+
18+
Report bugs at https://github.com/tparkerd/rawtools/issues.
19+
20+
If you are reporting a bug, please include:
21+
22+
* Your operating system name and version.
23+
* Any details about your local setup that might be helpful in troubleshooting.
24+
* Detailed steps to reproduce the bug.
25+
26+
Fix Bugs
27+
~~~~~~~~
28+
29+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
30+
wanted" is open to whoever wants to implement it.
31+
32+
Implement Features
33+
~~~~~~~~~~~~~~~~~~
34+
35+
Look through the GitHub issues for features. Anything tagged with "enhancement"
36+
and "help wanted" is open to whoever wants to implement it.
37+
38+
Write Documentation
39+
~~~~~~~~~~~~~~~~~~~
40+
41+
RAW Tools could always use more documentation, whether as part of the
42+
official RAW Tools docs, in docstrings, or even on the web in blog posts,
43+
articles, and such.
44+
45+
Submit Feedback
46+
~~~~~~~~~~~~~~~
47+
48+
The best way to send feedback is to file an issue at https://github.com/tparkerd/rawtools/issues.
49+
50+
If you are proposing a feature:
51+
52+
* Explain in detail how it would work.
53+
* Keep the scope as narrow as possible, to make it easier to implement.
54+
* Remember that this is a volunteer-driven project, and that contributions
55+
are welcome :)
56+
57+
Get Started!
58+
------------
59+
60+
Ready to contribute? Here's how to set up `rawtools` for local development.
61+
62+
1. Fork the `rawtools` repo on GitHub.
63+
2. Clone your fork locally::
64+
65+
$ git clone git@github.com:your_name_here/rawtools.git
66+
67+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
68+
69+
$ mkvirtualenv rawtools
70+
$ cd rawtools/
71+
$ python setup.py develop
72+
73+
4. Create a branch for local development::
74+
75+
$ git checkout -b name-of-your-bugfix-or-feature
76+
77+
Now you can make your changes locally.
78+
79+
5. When you're done making changes, check that your changes pass flake8 and the
80+
tests, including testing other Python versions with tox::
81+
82+
$ flake8 rawtools tests
83+
$ python setup.py test or pytest
84+
$ tox
85+
86+
To get flake8 and tox, just pip install them into your virtualenv.
87+
88+
6. Commit your changes and push your branch to GitHub::
89+
90+
$ git add .
91+
$ git commit -m "Your detailed description of your changes."
92+
$ git push origin name-of-your-bugfix-or-feature
93+
94+
7. Submit a pull request through the GitHub website.
95+
96+
Pull Request Guidelines
97+
-----------------------
98+
99+
Before you submit a pull request, check that it meets these guidelines:
100+
101+
1. The pull request should include tests.
102+
2. If the pull request adds functionality, the docs should be updated. Put
103+
your new functionality into a function with a docstring, and add the
104+
feature to the list in README.rst.
105+
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
106+
https://travis-ci.com/tparkerd/rawtools/pull_requests
107+
and make sure that the tests pass for all supported Python versions.
108+
109+
Tips
110+
----
111+
112+
To run a subset of tests::
113+
114+
$ pytest tests.test_rawtools
115+
116+
117+
Deploying
118+
---------
119+
120+
A reminder for the maintainers on how to deploy.
121+
Make sure all your changes are committed (including an entry in HISTORY.rst).
122+
Then run::
123+
124+
$ bump2version patch # possible: major / minor / patch
125+
$ git push
126+
$ git push --tags
127+
128+
Travis will then deploy to PyPI if tests pass.

HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=======
2+
History
3+
=======
4+
5+
0.1.0 (2020-06-19)
6+
------------------
7+
8+
* First release on PyPI.

MANIFEST.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include AUTHORS.rst
2+
include CONTRIBUTING.rst
3+
include HISTORY.rst
4+
include LICENSE
5+
include README.rst
6+
7+
recursive-include tests *
8+
recursive-exclude * __pycache__
9+
recursive-exclude * *.py[co]
10+
11+
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif

Makefile

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
.PHONY: clean clean-test clean-pyc clean-build docs help
2+
.DEFAULT_GOAL := help
3+
4+
define BROWSER_PYSCRIPT
5+
import os, webbrowser, sys
6+
7+
from urllib.request import pathname2url
8+
9+
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
10+
endef
11+
export BROWSER_PYSCRIPT
12+
13+
define PRINT_HELP_PYSCRIPT
14+
import re, sys
15+
16+
for line in sys.stdin:
17+
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
18+
if match:
19+
target, help = match.groups()
20+
print("%-20s %s" % (target, help))
21+
endef
22+
export PRINT_HELP_PYSCRIPT
23+
24+
BROWSER := python -c "$$BROWSER_PYSCRIPT"
25+
26+
help:
27+
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
28+
29+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
30+
31+
clean-build: ## remove build artifacts
32+
rm -fr build/
33+
rm -fr dist/
34+
rm -fr .eggs/
35+
find . -name '*.egg-info' -exec rm -fr {} +
36+
find . -name '*.egg' -exec rm -f {} +
37+
38+
clean-pyc: ## remove Python file artifacts
39+
find . -name '*.pyc' -exec rm -f {} +
40+
find . -name '*.pyo' -exec rm -f {} +
41+
find . -name '*~' -exec rm -f {} +
42+
find . -name '__pycache__' -exec rm -fr {} +
43+
44+
clean-test: ## remove test and coverage artifacts
45+
rm -fr .tox/
46+
rm -f .coverage
47+
rm -fr htmlcov/
48+
rm -fr .pytest_cache
49+
50+
lint: ## check style with flake8
51+
flake8 rawtools tests
52+
53+
test: ## run tests quickly with the default Python
54+
pytest
55+
56+
test-all: ## run tests on every Python version with tox
57+
tox
58+
59+
coverage: ## check code coverage quickly with the default Python
60+
coverage run --source rawtools -m pytest
61+
coverage report -m
62+
coverage html
63+
$(BROWSER) htmlcov/index.html
64+
65+
docs: ## generate Sphinx HTML documentation, including API docs
66+
rm -f docs/rawtools.rst
67+
rm -f docs/modules.rst
68+
sphinx-apidoc -o docs/ rawtools
69+
$(MAKE) -C docs clean
70+
$(MAKE) -C docs html
71+
$(BROWSER) docs/_build/html/index.html
72+
73+
servedocs: docs ## compile the docs watching for changes
74+
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
75+
76+
release: dist ## package and upload a release
77+
twine upload dist/*
78+
79+
dist: clean ## builds source and wheel package
80+
python setup.py sdist
81+
python setup.py bdist_wheel
82+
ls -l dist
83+
84+
install: clean ## install the package to the active Python's site-packages
85+
python setup.py install

README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=========
2+
RAW Tools
3+
=========
4+
5+
6+
7+
8+
9+
10+
Utility library for consuming and manipulating x-ray data in RAW format
11+
12+
13+
14+
Features
15+
--------
16+
17+
* TODO
18+
19+
Credits
20+
-------
21+
22+
This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.
23+
24+
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
25+
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = python -msphinx
7+
SPHINXPROJ = rawtools
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

0 commit comments

Comments
 (0)