- Contributing
- System Requirements
- App Requirements
- Repository Contribution
- Testing
- Code Coverage
- Code Style
- Linter
- Author
To contribute with Poke Trader
follow the guidelines below. Try not to run away from any step below, otherwise you will have problems with the installation and standardization of this package.
- Python >= 3.6
- MongoDB >= 3.6.8
- Setup development environment
python -m venv venv
source venv/bin/activate
(venv) pip install -U pip # update pip version to retrieve up to date lib versions
(venv) pip install -e .[dev]
- Addition of new libraries into this package
Insert your new library inside of setup.py file, choose the appropriate list, e.g. a production library goes into:
prod = [..., 'new_library']
- Create a issue with a feature or bug.
- Fork the project into your own repository and create a branch called
feature/[feature]
, where feature is the name of the feature that you are working on. - Update the branch
feature/[feature]
and send commits with the number of your issue at the message, e.g.:
git commit -m "solves commit #5"
- Run tests to check if everything is working fine (more information about how to run the tests in the section below).
- After run the tests and passed all of them, push your modifications and send a PR (Pull Resquest) to master.
This project has both unit and integration tests. They have same setup but a different way of running them:
-
Running unit tests:
pytest tests/unit
-
Running integrations tests
pytest tests/integration
pytest -vv tests/integration tests/unit --cov=src --cov=src/collector --cov=src/routers --cov=src/service --cov-report xml:coverage-reports/pytest-coverage-report-int.xml --junitxml=xunit-reports/xunit-result-pytest-int.xml --cov-report=html
Use Google Style Python Docstrings
for comments, e.g.:
def function_with_types_in_docstring(param1, param2):
"""Example function with types documented in the docstring.
`PEP 484`_ type annotations are supported. If attribute, parameter, and
return types are annotated according to `PEP 484`_, they do not need to be
included in the docstring:
Args:
param1 (int): The first parameter.
param2 (str): The second parameter.
Returns:
bool: The return value. True for success, False otherwise.
.. _PEP 484:
https://www.python.org/dev/peps/pep-0484/
"""
To automate import sorting and check for PEP8 problems:
isort --atomic --skip venv . # recursively modify files conform import sorting guidelines, skipping virtual environment folder
pycodestyle . # check for pep8 standards
bandit -r src # test python security analysis
[OPTIONAL]
Install a pre-commit hook to check pep8 errors before every commit. The hook can be overridden: git commit --no-verify
.
wget https://raw.githubusercontent.com/cbrueffer/pep8-git-hook/master/pre-commit && mv pre-commit .git/hooks/ && chmod +x .git/hooks/pre-commit
- Dayanne Fernandes:
- Github : @Dayof
- E-mail : dayannefernandesc@gmail.com