diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 98a7b7aa..e17750cd 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -28,8 +28,8 @@ search = version: {current_version} replace = version: {new_version} [bumpversion:file:HISTORY.rst] -search = .. comment:: bumpversion marker -replace = .. comment:: bumpversion marker +search = .. bumpversion marker +replace = .. bumpversion marker {new_version} ({now:%Y-%m-%d}) ------------------ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..3f8bc09a --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,30 @@ +# This is GitHub Action for cross platform building +name: docs +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + builds: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Build docs + env: + TOXENV: docs + run: | + pip install -r requirements-tests.txt + tox diff --git a/.gitignore b/.gitignore index 4c871135..7d677eb4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python +.venv/ env/ build/ develop-eggs/ @@ -63,4 +64,4 @@ target/ # Extra .DS_Store -.vscode \ No newline at end of file +.vscode diff --git a/.readthedocs.yml b/.readthedocs.yml index d64b57ed..b6994c9e 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,14 +5,13 @@ sphinx: fail_on_warning: true build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: # For available versions, see: # https://docs.readthedocs.io/en/stable/config-file/v2.html#build-tools-python - python: "3.7" # Keep in sync with .github/workflows/checks.yml - scrapy: "2.6.1" - + python: "3.12" + python: install: - requirements: docs/requirements.txt - - path: . \ No newline at end of file + - path: . diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e1ca882b..791081b5 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -18,7 +18,7 @@ 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! @@ -39,8 +39,8 @@ Fix Bugs Look through the GitHub issues for bugs. Anything tagged with "bug" is open to whoever wants to implement it. -Implement Features & imporvments -~~~~~~~~~~~~~~~~~~ +Implement Features & improvments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Look through the GitHub issues for features. Anything tagged with "feature" or "improvments" is open to whoever wants to implement it. @@ -70,7 +70,7 @@ 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:: @@ -93,7 +93,7 @@ Setup environment Now you can make your changes locally. 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:: @@ -128,9 +128,7 @@ Before you submit a pull request, check that it meets these guidelines: 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. -3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check - https://travis-ci.org/rolando/scrapy-redis/pull_requests - and make sure that the tests pass for all supported Python versions. +3. Make sure that the tests pass for all supported Python versions. Tips ---- diff --git a/HISTORY.rst b/HISTORY.rst index 753b321c..06549d30 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,7 +2,7 @@ History ======= -.. comment:: bumpversion marker +.. bumpversion marker 0.9.0 (2024-07-06) ------------------ diff --git a/docs/conf.py b/docs/conf.py index 91b4ca71..a5e37439 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -137,7 +137,7 @@ # here, relative to this directory. They are copied after the builtin # static files, so a file named "default.css" will overwrite the builtin # "default.css". -html_static_path = ["_static"] +# html_static_path = ["_static"] # If not '', a 'Last updated on:' timestamp is inserted at every page # bottom, using the given strftime format. diff --git a/docs/index.rst b/docs/index.rst index 9e89e21e..d38f4241 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,7 @@ contain the root `toctree` directive. Welcome to Scrapy-Redis's documentation! -====================================== +======================================== Contents: @@ -13,7 +13,10 @@ Contents: readme installation + modules + contributing history + authors Indices and tables ================== diff --git a/docs/modules.rst b/docs/modules.rst index 569a8671..e930c12b 100644 --- a/docs/modules.rst +++ b/docs/modules.rst @@ -1,5 +1,5 @@ -scrapy_redis -============ +API Reference +============= .. toctree:: :maxdepth: 4 diff --git a/src/scrapy_redis/spiders.py b/src/scrapy_redis/spiders.py index 9ca48a87..67111932 100644 --- a/src/scrapy_redis/spiders.py +++ b/src/scrapy_redis/spiders.py @@ -155,6 +155,8 @@ def make_request_from_data(self, data): For example: + .. code:: json + { "url": "https://example.com", "meta": { diff --git a/tox.ini b/tox.ini index 8e825c2e..1ef077bc 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ requires = tox>=4 envlist = + docs security flake8 py{38,39,310,311,312}-scrapy{26,27,28,29,210,211}-redis{42,43,44,45,46,50} @@ -75,3 +76,15 @@ deps = build commands = python -m build + +[testenv:docs] +basepython = + python3.12 +deps = + {[base]deps} + -r docs/requirements.txt +allowlist_externals = + make +commands = + # Same command as readthedocs + make -C docs html SPHINXOPTS="-T -W --keep-going -D language=en"