Skip to content

Commit 5fb3c9f

Browse files
committed
Initial Commit
0 parents  commit 5fb3c9f

27 files changed

+1024
-0
lines changed

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.bat]
14+
indent_style = tab
15+
end_of_line = crlf
16+
17+
[LICENSE]
18+
insert_final_newline = false
19+
20+
[Makefile]
21+
indent_style = tab

.github/ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* Cardea version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.

.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
58+
# Flask stuff:
59+
instance/
60+
.webassets-cache
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
# Jupyter Notebook
72+
.ipynb_checkpoints
73+
74+
# pyenv
75+
.python-version
76+
77+
# celery beat schedule file
78+
celerybeat-schedule
79+
80+
# SageMath parsed files
81+
*.sage.py
82+
83+
# dotenv
84+
.env
85+
86+
# virtualenv
87+
.venv
88+
venv/
89+
ENV/
90+
91+
# Spyder project settings
92+
.spyderproject
93+
.spyproject
94+
95+
# Rope project settings
96+
.ropeproject
97+
98+
# mkdocs documentation
99+
/site
100+
101+
# mypy
102+
.mypy_cache/
103+
104+
# vim
105+
.*.swp

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Config file for automatic testing at travis-ci.org
2+
language: python
3+
python:
4+
- 3.6
5+
- 3.5
6+
7+
# Command to install dependencies
8+
install: pip install -U tox-travis
9+
10+
# Command to run tests
11+
script: tox
12+
13+
deploy:
14+
15+
# Automatically build and deploy documentation to GitHub Pages after every
16+
# commit
17+
# Follow the instructions at https://docs.travis-ci.com/user/deployment/pages/
18+
# to setup a personal deployment token and then provide it as a secure
19+
# environment variable at https://travis-ci.org/D3-AI/Cardea/settings
20+
- provider: pages
21+
skip-cleanup: true
22+
github-token: "$GITHUB_TOKEN"
23+
keep-history: true
24+
local-dir: docs/_build/html
25+
target-branch: gh-pages
26+
on:
27+
branch: master
28+
python: 3.6
29+

AUTHORS.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
=======
2+
Credits
3+
=======
4+
5+
Contributors
6+
------------
7+
8+
* Carles Sala <[email protected]>
9+
* Sebastià Mir <[email protected]>

CONTRIBUTING.rst

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
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/D3-AI/Cardea/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+
Cardea could always use more documentation, whether as part of the
42+
official Cardea 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/D3-AI/Cardea/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 `Cardea` for local development.
61+
62+
1. Fork the `Cardea` repo on GitHub.
63+
2. Clone your fork locally::
64+
65+
$ git clone [email protected]:your_name_here/Cardea.git
66+
67+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed,
68+
this is how you set up your fork for local development::
69+
70+
$ mkvirtualenv Cardea
71+
$ cd Cardea/
72+
$ pip install -e .
73+
$ pip install -r requirements_dev.txt
74+
75+
4. Create a branch for local development::
76+
77+
$ git checkout -b name-of-your-bugfix-or-feature
78+
79+
Now you can make your changes locally.
80+
81+
5. While hacking your changes, make sure to cover all your developments with the required
82+
unit tests, and that none of the old tests fail as a consequence of your changes.
83+
For this, make sure to run the tests suite and check the code coverage::
84+
85+
$ make test # Run the tests
86+
$ make coverage # Get the coverage report
87+
88+
6. When you're done making changes, check that your changes pass flake8 and the
89+
tests, including testing other Python versions with tox::
90+
91+
$ make test-all
92+
93+
7. Make also sure to include the necessary documentation in the code as docstrings following
94+
the [google](https://google.github.io/styleguide/pyguide.html?showone=Comments#Comments)
95+
or the [numpy](https://numpydoc.readthedocs.io/en/latest/format.html) docstring style.
96+
If you want to view how your documentation will look like when it is published, you can
97+
generate and view the docs with this command::
98+
99+
$ make viewdocs
100+
101+
8. Commit your changes and push your branch to GitHub::
102+
103+
$ git add .
104+
$ git commit -m "Your detailed description of your changes."
105+
$ git push origin name-of-your-bugfix-or-feature
106+
107+
9. Submit a pull request through the GitHub website.
108+
109+
Pull Request Guidelines
110+
-----------------------
111+
112+
Before you submit a pull request, check that it meets these guidelines:
113+
114+
1. It resolves an open GitHub Issue and contains its reference in the title or
115+
the comment. If there is no associated issue, feel free to create one.
116+
2. Whenever possible, it resolves only **one** issue. If your PR resolves more than
117+
one issue, try to split it in more than one pull request.
118+
3. The pull request should include unit tests that cover all the changed code
119+
4. If the pull request adds functionality, the docs should be updated. Put
120+
your new functionality into a function with a docstring, and add the
121+
feature to the list in README.rst.
122+
5. The pull request should work for Python2.7, 3.4, 3.5 and 3.6. Check
123+
https://travis-ci.org/D3-AI/Cardea/pull_requests
124+
and make sure that all the checks pass.
125+
126+
Unit Testing Guidelines
127+
-----------------------
128+
129+
All the Unit Tests should comply with the following requirements:
130+
131+
1. Unit Tests should be based only in unittest and pytest modules.
132+
133+
2. The tests that cover a module called ``cardea/path/to/a_module.py`` should be
134+
implemented in a separated module called ``tests/cardea/path/to/test_a_module.py``.
135+
Note that the module name has the ``test_`` prefix and is located in a path similar
136+
to the one of the tested module, just inside te ``tests`` folder.
137+
138+
3. Each method of the tested module should have at least one associated test method, and
139+
each test method should cover only **one** use case or scenario.
140+
141+
4. Test case methods should start with the ``test_`` prefix and have descriptive names
142+
that indicate which scenario they cover.
143+
Names such as ``test_some_methed_input_none``, ``test_some_method_value_error`` or
144+
``test_some_method_timeout`` are right, but names like ``test_some_method_1``,
145+
``some_method`` or ``test_error`` are not.
146+
147+
5. Each test should validate only what the code of the method being tested does, and not
148+
cover the behavior of any third party package or tool being used, which is assumed to
149+
work properly as far as it is being passed the right values.
150+
151+
6. Any third party tool that may have any kind of random behavior, such as some Machine
152+
Learning models, databases or Web APIs, will be mocked using the ``mock`` library, and
153+
the only thing that will be tested is that our code passes the right values to them.
154+
155+
7. Unit tests should not use anything from outside the test and the code being tested. This
156+
includes not reading or writting to any filesystem or database, which will be properly
157+
mocked.
158+
159+
Tips
160+
----
161+
162+
To run a subset of tests::
163+
164+
$ pytest tests.test_cardea
165+
166+
Release Workflow
167+
----------------
168+
169+
The process of releasing a new version involves several steps combining both ``git`` and
170+
``bumpversion`` which, briefly:
171+
172+
1. Merge what is in ``master`` branch into ``stable`` branch.
173+
2. Update the version in ``setup.cfg``, ``cardea/__init__.py`` and ``HISTORY.md`` files.
174+
3. Create a new TAG pointing at the correspoding commit in ``stable`` branch.
175+
4. Merge the new commit from ``stable`` into ``master``.
176+
5. Update the version in ``setup.cfg`` and ``cardea/__init__.py`` to open the next
177+
development interation.
178+
179+
**Note:** Before starting the process, make sure that ``HISTORY.md`` has a section titled
180+
**Unreleased** with the list of changes that will be included in the new version, and that
181+
these changes are committed and available in ``master`` branch.
182+
Normally this is just a list of the Pull Requests that have been merged since the latest version.
183+
184+
Once this is done, just run the following commands::
185+
186+
git checkout stable
187+
git merge --no-ff master # This creates a merge commit
188+
bumpversion release # This creates a new commit and a TAG
189+
git push --tags origin stable
190+
make release
191+
git checkout master
192+
git merge stable
193+
bumpversion --no-tag patch
194+
git push

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# History
2+
3+
## 0.1.0
4+
5+
* First release on PyPI.

0 commit comments

Comments
 (0)