Skip to content

Commit

Permalink
docs: fix readthedocs (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmax authored Jul 6, 2024
1 parent 3245d28 commit 1457d4d
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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})
------------------
30 changes: 30 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/

# Distribution / packaging
.Python
.venv/
env/
build/
develop-eggs/
Expand Down Expand Up @@ -63,4 +64,4 @@ target/

# Extra
.DS_Store
.vscode
.vscode
9 changes: 4 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: .
- path: .
14 changes: 6 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand All @@ -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.
Expand Down Expand Up @@ -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::
Expand All @@ -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::

Expand Down Expand Up @@ -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
----
Expand Down
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
History
=======

.. comment:: bumpversion marker
.. bumpversion marker
0.9.0 (2024-07-06)
------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
contain the root `toctree` directive.
Welcome to Scrapy-Redis's documentation!
======================================
========================================

Contents:

Expand All @@ -13,7 +13,10 @@ Contents:

readme
installation
modules
contributing
history
authors

Indices and tables
==================
Expand Down
4 changes: 2 additions & 2 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scrapy_redis
============
API Reference
=============

.. toctree::
:maxdepth: 4
Expand Down
2 changes: 2 additions & 0 deletions src/scrapy_redis/spiders.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def make_request_from_data(self, data):
For example:
.. code:: json
{
"url": "https://example.com",
"meta": {
Expand Down
13 changes: 13 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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"

0 comments on commit 1457d4d

Please sign in to comment.