Skip to content

Commit b94bdf1

Browse files
authored
Added contribution guidelines
* Added contribution guidelines * Updated travis CI to use tox
1 parent 7e81172 commit b94bdf1

File tree

7 files changed

+321
-32
lines changed

7 files changed

+321
-32
lines changed

.gitignore

Lines changed: 116 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,117 @@
1-
.idea/
2-
.DS_Store
3-
dist
1+
2+
# Created by https://www.gitignore.io/api/python
3+
# Edit at https://www.gitignore.io/?templates=python
4+
5+
### Python ###
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# C extensions
12+
*.so
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
pip-wheel-metadata/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
433
MANIFEST
5-
reportportal_client.egg-info
6-
*.pyc
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
.hypothesis/
56+
.pytest_cache/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
# pyenv
72+
.python-version
73+
74+
# virtualenv
75+
venv/
76+
.venv/
77+
78+
# pycharm
79+
.idea/
80+
81+
# pipenv
82+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
83+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
84+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
85+
# install all needed dependencies.
86+
#Pipfile.lock
87+
88+
# celery beat schedule file
89+
celerybeat-schedule
90+
91+
# SageMath parsed files
92+
*.sage.py
93+
94+
# Spyder project settings
95+
.spyderproject
96+
.spyproject
97+
98+
# Rope project settings
99+
.ropeproject
100+
101+
# Mr Developer
102+
.mr.developer.cfg
103+
.project
104+
.pydevproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/
111+
.dmypy.json
112+
dmypy.json
113+
114+
# Pyre type checker
115+
.pyre/
116+
117+
# End of https://www.gitignore.io/api/python

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v2.5.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
- id: check-added-large-files
11+
- id: flake8
12+
- repo: https://github.com/PyCQA/pydocstyle
13+
rev: 5.0.2
14+
hooks:
15+
- id: pydocstyle
16+
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
17+
rev: v1.0.0
18+
hooks:
19+
- id: rst-linter

.travis.yml

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
1-
stages:
2-
- test
3-
- name: deploy
4-
if: tag IS present
51
language: python
2+
63
python:
74
- "2.7"
85
- "3.5"
96
- "3.6"
107
- "3.7"
118
- "3.8"
9+
10+
os:
11+
- linux
12+
1213
install:
13-
- pip install pycodestyle pydocstyle pytest delayed-assert requests
14-
before_script:
15-
- pycodestyle .
16-
- pydocstyle .
14+
- pip install --upgrade pip
15+
- pip install tox-travis
16+
1717
script:
18-
- pytest tests/ -s -vv
19-
- python setup.py -q install
20-
jobs:
21-
include:
22-
- stage: deploy
23-
python: '3.6'
24-
install: skip
25-
before_script: skip
26-
script: skip
27-
deploy:
28-
stage: deploy
29-
provider: pypi
30-
on:
31-
tags: true
32-
distributions: sdist bdist_wheel
33-
user: reportportal
34-
password:
35-
secure: r464kwpTXfws7uEEeF70GlJV5YBGqmDDMFSKd3uhlSOK3GDQNQH9q+tMd1OlpHegUaEQ26nnuO0kXqpYrOSiAy8L03WTqhT840I6Y9MYCG/yarrGHs+7L4cF4iQTiUewBuaNO6uwtWBssa9I4mcV6QuRt4zYDzKFGtP6BGm6MAb0IBRNr0cthjbcVajeO91qmTl9TPKHWXRlXhcLqThDshkO/NhOsjJJzMxCMEycjCFM/MywpIOZkgR2YWkiSazMjb9KUVQFCGxl+vnCHFwHhvn/igNNLCUq2dR5r8JQ4HX08uefQSycZBXGEQJ4C3X08VfBk5PKUNOpBR+puYfgKG+UTQl/Z39BDXOVDC47OjP6gI1tcJnpIRlWjYjWU8yXqnkBN28BOycqTB8ewYnq0ni2Cys4AD4IXaPWxmdYJGlxxpLGN1UYzPINi5S6yRzelo0krOg7VEocw/kRC1Cz0hZTN1YdzIsw3GAcadSOEAi2LeUaKqtox9s/eLmkDvZEInWADuW9ofEyMyVi+8pV0CvjhMJ9cn3fBDaVRcotPcPlmZFJdCxEH5X21svSuj7REIu2Uee+pZlqEBuYLZaICVTgG3431xeWRTsaHR9r4+xFnrr6t+xnEdFF45ZcBluX02v/ACtMTZaRJIBh/FyozEkHa84Uujpyuv8hZud9X4Q=
18+
- tox

CONTRIBUTING.rst

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
============
2+
Contribution
3+
============
4+
5+
Contributions are highly welcomed and appreciated.
6+
7+
.. contents::
8+
:depth: 2
9+
:backlinks: none
10+
11+
Feature requests
12+
----------------
13+
14+
We'd also like to hear about your thoughts and suggestions. Feel free to
15+
`submit them as issues <https://github.com/reportportal/client-Python/issues>`_ and:
16+
17+
* Explain in detail how they should work.
18+
* Keep the scope as narrow as possible. It will make it easier to implement.
19+
20+
Bug reports
21+
-----------
22+
23+
Report bugs for the client in the `issue tracker <https://github.com/reportportal/client-Python/issues>`_.
24+
25+
If you are reporting a new bug, please include:
26+
27+
* Your operating system name and version.
28+
* Python interpreter version, installed libraries, and reportportal-client
29+
version.
30+
* Detailed steps to reproduce the bug.
31+
32+
Bug fixes
33+
---------
34+
35+
Look through the `GitHub issues for bugs <https://github.com/reportportal/client-Python/labels/bug>`_.
36+
37+
If you are gonna fix any of existing bugs, assign that bug to yourself and specify preliminary milestones.
38+
Talk to `contributors <https://github.com/reportportal/client-Python/graphs/contributors>`_ in case you need a
39+
consultancy regarding implementation.
40+
41+
Implement features
42+
------------------
43+
44+
Look through the `GitHub issues for enhancements <https://github.com/reportportal/client-Python/labels/enhancement>`_.
45+
46+
Talk to `contributors <https://github.com/reportportal/client-Python/graphs/contributors>`_ in case you need a
47+
consultancy regarding implementation.
48+
49+
Preparing Pull Requests
50+
-----------------------
51+
52+
What is a "pull request"? It informs the project's core developers about the
53+
changes you want to review and merge. Pull requests are stored on
54+
`GitHub servers <https://github.com/reportportal/client-Python/pulls>`_.
55+
Once you send a pull request, we can discuss its potential modifications and
56+
even add more commits to it later on. There's an excellent tutorial on how Pull
57+
Requests work in the
58+
`GitHub Help Center <https://help.github.com/articles/using-pull-requests/>`_.
59+
60+
Here is a simple overview below:
61+
62+
#. Fork the
63+
`reportportal-client GitHub repository <https://github.com/reportportal/client-Python>`_.
64+
65+
#. Clone your fork locally using `git <https://git-scm.com/>`_ and create a branch::
66+
67+
$ git clone [email protected]:YOUR_GITHUB_USERNAME/client-Python.git
68+
$ cd client-Python
69+
# now, create your own branch off the "master":
70+
71+
$ git checkout -b your-bugfix-branch-name
72+
73+
If you need some help with Git, follow this quick start
74+
guide: https://git.wiki.kernel.org/index.php/QuickStart
75+
76+
#. Install tox
77+
78+
Tox is used to run all the tests and will automatically setup virtualenvs
79+
to run the tests in.
80+
(will implicitly use http://www.virtualenv.org/en/latest/)::
81+
82+
$ pip install tox
83+
84+
#. Run all the tests
85+
86+
You need to have Python 3.6 available in your system. Now
87+
running tests is as simple as issuing this command::
88+
89+
$ tox -e pep,py36
90+
91+
This command will run tests via the "tox" tool against Python 3.6
92+
and also perform code style checks.
93+
94+
#. You can now edit your local working copy and run the tests again as necessary. Please follow PEP-8 recommendations.
95+
96+
You can pass different options to ``tox``. For example, to run tests on Python 3.6 and pass options to pytest
97+
(e.g. enter pdb on failure) to pytest you can do::
98+
99+
$ tox -e py36 -- --pdb
100+
101+
Or to only run tests in a particular test module on Python 3.6::
102+
103+
$ tox -e py36 -- tests/test_service.py
104+
105+
106+
When committing, ``pre-commit`` will re-format the files if necessary.
107+
108+
#. If instead of using ``tox`` you prefer to run the tests directly, then we suggest to create a virtual environment and use
109+
an editable install with the ``testing`` extra::
110+
111+
$ python3 -m venv .venv
112+
$ source .venv/bin/activate # Linux
113+
$ .venv/Scripts/activate.bat # Windows
114+
$ pip install -e ".[testing]"
115+
116+
Afterwards, you can edit the files and run pytest normally::
117+
118+
$ pytest tests/test_service.py
119+
120+
121+
#. Commit and push once your tests pass and you are happy with your change(s)::
122+
123+
$ git commit -m "<commit message>"
124+
$ git push -u
125+
126+
127+
#. Finally, submit a pull request through the GitHub website using this data::
128+
129+
head-fork: YOUR_GITHUB_USERNAME/client-Python
130+
compare: your-branch-name
131+
132+
base-fork: reportportal/client-Python
133+
base: master

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[build-system]
2+
requires = [
3+
# sync with setup.py until we discard non-pep-517/518
4+
"setuptools>=40.0",
5+
"setuptools-scm",
6+
"wheel",
7+
]
8+
build-backend = "setuptools.build_meta"

tests/test_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def test_get_system_information_docker(self):
123123
mock.Mock(side_effect=DistributionNotFound))
124124
def test_get_system_information_without_pkg(self):
125125
"""Test in negative form for validate get_system_information."""
126-
127126
expected_result = {'agent': 'not found',
128127
'cpu': 'amd',
129128
'machine': 'Windows-PC',

tox.ini

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[tox]
2+
isolated_build = True
3+
envlist =
4+
pep
5+
py27
6+
py35
7+
py36
8+
py37
9+
py38
10+
11+
[testenv]
12+
deps =
13+
pytest
14+
delayed-assert
15+
requests
16+
commands = python -m pytest tests/ -s -vv
17+
18+
[testenv:pep]
19+
skip_install = True
20+
deps = pre-commit>=1.11.0
21+
commands = pre-commit run --all-files --show-diff-on-failure
22+
23+
[testenv:py27]
24+
deps =
25+
mock
26+
pytest
27+
delayed-assert
28+
requests
29+
30+
[travis]
31+
python =
32+
2.7: py27
33+
3.5: py35
34+
3.6: pep,py36
35+
3.7: py37
36+
3.8: py38

0 commit comments

Comments
 (0)