diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ff6ea672..e1ca882b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,7 +1,7 @@ .. highlight:: shell ============ -Contributing +Contribution ============ Contributions are welcome, and they are greatly appreciated! Every @@ -12,10 +12,20 @@ You can contribute in many ways: Types of Contributions ---------------------- +New to here +~~~~~~~~~~~ + +Any issue with good first issue tag on it is a great place to start! Feel free to ask any questions here. + +Don't know how to start +~~~~~~~~~~~ + +Review codebases and PRs can give you quite a knowledge to know what's going on here! + Report Bugs ~~~~~~~~~~~ -Report bugs at https://github.com/rolando/scrapy-redis/issues. +Report bugs at https://github.com/rmax/scrapy-redis/issues. If you are reporting a bug, please include: @@ -29,10 +39,10 @@ Fix Bugs Look through the GitHub issues for bugs. Anything tagged with "bug" is open to whoever wants to implement it. -Implement Features +Implement Features & imporvments ~~~~~~~~~~~~~~~~~~ -Look through the GitHub issues for features. Anything tagged with "feature" +Look through the GitHub issues for features. Anything tagged with "feature" or "improvments" is open to whoever wants to implement it. Write Documentation @@ -45,7 +55,7 @@ articles, and such. Submit Feedback ~~~~~~~~~~~~~~~ -The best way to send feedback is to file an issue at https://github.com/rolando/scrapy-redis/issues. +The best way to send feedback is to file an issue at https://github.com/rmax/scrapy-redis/issues. If you are proposing a feature: @@ -59,6 +69,9 @@ Get Started! Ready to contribute? Here's how to set up `scrapy-redis` for local development. +Setup environment +~~~~~~~~~~~~~~~ + 1. Fork the `scrapy-redis` repo on GitHub. 2. Clone your fork locally:: @@ -70,6 +83,7 @@ Ready to contribute? Here's how to set up `scrapy-redis` for local development. virtualenv --python=/usr/bin/python3 ~/scrapy_redis source ~/scrapy_redis/bin/activate cd scrapy-redis/ + pip install -r requirements-install.txt pip install . 4. Create a branch for local development:: @@ -78,30 +92,32 @@ Ready to contribute? Here's how to set up `scrapy-redis` for local development. Now you can make your changes locally. -5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: +Setup testing environment +~~~~~~~~~~~~~~~ +1. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:: + + pip install -r requirements-tests.txt flake8 src/ tests/ python -m pytest --ignore=setup.py tox - To get flake8 and tox, just pip install them into your virtualenv. - -6. Note that if the error of `No module named scrapy_redis` shows, please check the install `scrapy-redis` of your branch by:: +2. Note that if the error of `No module named scrapy_redis` shows, please check the install `scrapy-redis` of your branch by:: pip install . -7. Or change the import lines:: +3. Or change the import lines:: from scrapy_redis import xxx # from this from src.scrapy_redis import xxx # to this -8. Commit your changes and push your branch to GitHub:: +4. Commit your changes and push your branch to GitHub:: git add . git commit -m "Your detailed description of your changes." git push origin name-of-your-bugfix-or-feature -9. Submit a pull request through the GitHub website. +5. Submit a pull request through the GitHub website. Pull Request Guidelines ----------------------- diff --git a/requirements-tests.txt b/requirements-tests.txt index 7c769b52..72c6790b 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,6 +1,6 @@ # This packages are required to run all the tests. -coverage flake8 mock pytest +pytest-cov tox diff --git a/tox.ini b/tox.ini index 8adb3600..71796d5e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,21 +1,45 @@ [tox] # TODO: added redis-py version matrix. -envlist = py{27,34,35}-scrapy{10,11,12,1x,rel,dev} +# TODO: envlist = py{27,34,35}-scrapy{10,11,12,1x,rel,dev} +envlist = security,flake8,py37,py38,py39,py310 +minversion = 1.7.0 + +[base] +deps = + scrapy>=2.4 + redis>=4.0 + six>=1.5.2 [testenv] -basepython = - py27: python2.7 - py34: python3.4 - py35: python3.5 +basepython = + py37: python3.7 + py38: python3.8 + py39: python3.9 + py310: python3.10 +deps = + {[base]deps} + mock + pytest + pytest-cov +commands = + pip install . + python -m pytest --ignore=setup.py # --cov-report term --cov=scrapy_redis + +[testenv:flake8] +deps = + {[base]deps} + flake8 # https://github.com/tholo/pytest-flake8/issues/81 +commands = + flake8 docs tests + +[testenv:security] deps = - -rrequirements-setup.txt - -rrequirements-install.txt - -rrequirements-tests.txt + bandit==1.7.3 commands = - scrapy10: pip install scrapy>=1.0,<1.1 - scrapy11: pip install scrapy>=1.1,<1.2 - scrapy12: pip install scrapy>=1.2,<1.3 - scrapy1x: pip install scrapy>=1.0,<2.0 - scrapyrel: pip install scrapy - scrapydev: pip install https://github.com/scrapy/scrapy/archive/master.zip - {posargs:coverage run -m pytest --ignore=setup.py } + bandit -r -c .bandit.yml src/ tests/ + +# TODO: add pylint + +# TODO: build windows/linux/mac + +# TODO: build docs \ No newline at end of file