Giter VIP home page Giter VIP logo

Comments (6)

csernazs avatar csernazs commented on August 29, 2024

Hi!

Thanks for the report, I'll fix then soon. It is interesting that for example, re.compile function reference target not found.

Probably I would run sphinx-build with -n in the future.

from pytest-httpserver.

kloczek avatar kloczek commented on August 29, 2024

Gosh I forgot about another three small details:

  • missing module path adjustment in copy.py file.
    This can be fixed by patch like below:
--- a/doc/conf.py~      2022-01-27 18:47:16.000000000 +0000
+++ b/doc/conf.py       2022-04-22 09:22:06.864753322 +0000
@@ -17,9 +17,9 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
+import os
+import sys
+sys.path.insert(0, os.path.abspath('..'))
 from typing import Dict

That patch is doing exactly what is mentioned in above comment. Without that sphinx-build is not able to find pytest-httpserver module.

  • In my build procedure I've removed use reno module because I'm using as input resource autogenerated from git tag by github tar ball. Instead generating changelog from git log I've replaced that by include ../CHANGES.rst. reno uses dulwich which needs git repo tree. Here is the patch which I'm using:
--- a/doc/conf.py~      2022-04-22 09:24:53.000000000 +0000
+++ b/doc/conf.py       2022-04-22 09:27:08.905774337 +0000
@@ -34,7 +34,6 @@
 # ones.
 extensions = [
     'sphinx.ext.autodoc',
-    'reno.sphinxext',
 ]

 # Add any paths that contain templates here, relative to this directory.
--- a/doc/changes.rst~  2022-01-27 18:47:16.000000000 +0000
+++ b/doc/changes.rst   2022-04-22 09:33:15.944804618 +0000
@@ -1,4 +1,4 @@
 .. _changes:

-.. release-notes:: Release Notes
+.. include:: ../CHANGES.rst
  • I've trimmed a bit include list in pyproject.toml to not install some files and directories. Here is the result of installation in </install/prefix> without patching:
[tkloczko@devel-g2v site-packages]$ pwd; ls -la
/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-httpserver-1.0.4-2.fc35.x86_64/usr/lib/python3.8/site-packages
total 24
drwxr-xr-x. 1 tkloczko tkloczko  238 Apr 22 10:21 .
drwxr-xr-x. 1 tkloczko tkloczko   26 Apr 22 10:21 ..
-rw-r--r--. 1 tkloczko tkloczko 9364 Apr 22 10:21 CHANGES.rst
-rw-r--r--. 1 tkloczko tkloczko 2625 Apr 22 10:21 CONTRIBUTION.md
-rwxr-xr-x. 1 tkloczko tkloczko  392 Apr 22 10:21 example.py
-rw-r--r--. 1 tkloczko tkloczko 1329 Apr 22 10:21 example_pytest.py
drwxr-xr-x. 1 tkloczko tkloczko  354 Apr 22 10:21 __pycache__
drwxr-xr-x. 1 tkloczko tkloczko  118 Apr 22 10:21 pytest_httpserver
drwxr-xr-x. 1 tkloczko tkloczko  120 Apr 22 10:21 pytest_httpserver-1.0.4.dist-info
drwxr-xr-x. 1 tkloczko tkloczko  532 Apr 22 10:21 tests

and here is the patch:

--- a/pyproject.toml~   2022-01-27 18:47:16.000000000 +0000
+++ b/pyproject.toml    2022-04-09 13:21:23.202846599 +0000
@@ -23,12 +23,6 @@
 repository = "https://github.com/csernazs/pytest-httpserver"

 include = [
-    "tests",
-    "CHANGES.rst",
-    "CONTRIBUTION.md",
-    "tests/*.py",
-    "tests/assets/*",
-    "example*.py",
     "requirements-doc.txt",
     "doc",
     "setup.cfg",

Feel free to commit those changes.

from pytest-httpserver.

csernazs avatar csernazs commented on August 29, 2024

Thanks for the changes. Using reno from sphinx was a pain always and incuding the changelog probably makes the sphinx build better by not requiring extra dependencies (background: in the first versions of pytest-httpserver there was no changelog.rst, so I had to use the reno sphinx plugin to have changelog in the docs).

For the pyproject.toml, my idea was to include everything to the sdist, including tests, docs, examples, etc, the idea was that if you download the sdist, you could build the project.
Based on the documentation it seems I'm missing it with the Source archive which is not the sdist.

from pytest-httpserver.

kloczek avatar kloczek commented on August 29, 2024

That patch for me was kind of JFDI solution pointing that it is some issue and this is I've not suggested to include it in exactly that formπŸ˜„
Definitely other modules are able granularly choose what will be in sdist and what will be in .whl πŸ˜ƒ

from pytest-httpserver.

kloczek avatar kloczek commented on August 29, 2024

Thank you πŸ˜„
Just tested that commit and still I see one minor warning:

+ /usr/bin/sphinx-build -n -T -b man doc build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://werkzeug.palletsprojects.com/en/2.1.x/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 9 added, 0 changed, 0 removed
reading sources... [100%] upgrade
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/tkloczko/rpmbuild/BUILD/pytest-httpserver-1.0.4/doc/guide.rst: WARNING: document isn't included in any toctree
done
writing... python-pytest-httpserver.3 { tutorial howto fixtures api background changes upgrade } done
build succeeded, 1 warning.

Just FTR. Here is as well my uptaded patch which removed use reno ext (if you don't want it I'll keep it in my build rpvedore of the rpm package)

--- a/doc/conf.py~      2022-04-26 07:23:10.000000000 +0000
+++ b/doc/conf.py       2022-04-26 07:23:47.347486137 +0000
@@ -36,7 +36,6 @@
 # ones.
 extensions = [
     'sphinx.ext.autodoc',
-    'reno.sphinxext',
     'sphinx.ext.intersphinx',
 ]

--- a/doc/changes.rst~  2022-01-27 18:47:16.000000000 +0000
+++ b/doc/changes.rst   2022-04-22 09:33:15.944804618 +0000
@@ -1,4 +1,4 @@
 .. _changes:

-.. release-notes:: Release Notes
+.. include:: ../CHANGES.rst

from pytest-httpserver.

csernazs avatar csernazs commented on August 29, 2024

Thanks for the suggestions, I never thought that external references will work with sphinx and now everyting I checked points to the right place. Werkzeug links are working as well, which is great as Request and Response objects from werkzeug are transparent in pytest-httpserver's API.

The warning about guide.rst is normal, this is an old page and this has been superseded by the howto and tutorial and other pages: https://pytest-httpserver.readthedocs.io/en/latest/guide.html
There were still 8 hits in the last 30 days (not a big number I admit :)) so this is not a problem for me to have a warning for this if people get meaningful info instead of 404.

I have also integrated the reno removal:
d69f1d7

IMO that's the same patch as you wrote (+ the pyproject.toml change).

from pytest-httpserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.