Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphinx: 5.3.0 -> 7.0.1 #244625

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fb4a272
sphinx: 5.3.0 -> 7.0.1
ncfavier Jan 12, 2023
16d6eb6
setuptools: add hook to delete -nspkg.pth files
tjni Jul 21, 2023
1cc3120
python310Packages.sphinxcontrib-applehelp: 1.0.2 -> 1.0.4
tjni Jul 21, 2023
8e1f9b5
python310Packages.sphinxcontrib-httpdomain: rename from sphinxcontrib…
tjni Jul 21, 2023
b3dd023
python310Packages.sphinxcontrib-httpdomain: remove *-nspkg.pth file
tjni Jul 21, 2023
fd9b7b1
python310Packages.sphinxcontrib-newsfeed: rename from sphinxcontrib_n…
tjni Jul 21, 2023
b5b0936
python310Packages.sphinxcontrib-newsfeed: remove *-nspkg.pth file
tjni Jul 21, 2023
379d1f6
python310Packages.sphinxcontrib-actdiag: remove *-nspkg.pth file
tjni Jul 21, 2023
f38f812
python310Packages.sphinxcontrib-apidoc: remove *-nspkg.pth file
tjni Jul 21, 2023
bc420b3
python310Packages.sphinxcontrib-bayesnet: remove *-nspkg.pth file
tjni Jul 21, 2023
d580661
python310Packages.sphinxcontrib-bibtex: remove *-nspkg.pth file
tjni Jul 21, 2023
6378e24
python310Packages.sphinxcontrib-blockdiag: remove *-nspkg.pth file
tjni Jul 21, 2023
b87aeea
python310Packages.sphinxcontrib-confluencebuilder: 2.0.0 -> 2.1.1
tjni Jul 21, 2023
a30a761
python310Packages.sphinxcontrib-devhelp: remove *-nspkg.pth file
tjni Jul 21, 2023
2a45827
python310Packages.sphinxcontrib-excel-table: add missing dependencies
tjni Jul 21, 2023
6d5c715
python310Packages.sphinxcontrib-fulltoc: remove *-nspkg.pth file
tjni Jul 21, 2023
51cba80
python310Packages.sphinxcontrib-htmlhelp: 2.0.0 -> 2.0.1
tjni Jul 21, 2023
67a7415
python310Packages.sphinxcontrib-jsmath: remove *-nspkg.pth file
tjni Jul 21, 2023
98405c8
python310Packages.sphinxcontrib-log-cabinet: remove *-nspkg.pth file
tjni Jul 21, 2023
46d825f
python310Packages.sphinxcontrib-mscgen: remove *-nspkg.pth file
tjni Jul 21, 2023
c557181
python310Packages.sphinxcontrib-nwdiag: remove *-nspkg.pth file
tjni Jul 21, 2023
3b3f73a
python310Packages.sphinxcontrib-openapi: remove *-nspkg.pth file
tjni Jul 21, 2023
3b1f932
python310Packages.sphinxcontrib-plantuml: remove *-nspkg.pth file
tjni Jul 21, 2023
b863da4
python310Packages.sphinxcontrib-programoutput: remove *-nspkg.pth file
tjni Jul 21, 2023
647c05b
python310Packages.sphinxcontrib-qthelp: remove *-nspkg.pth file
tjni Jul 21, 2023
748da09
python310Packages.sphinxcontrib-seqdiag: remove *-nspkg.pth file
tjni Jul 21, 2023
ce42bdf
python310Packages.sphinxcontrib-serializinghtml: remove *-nspkg.pth file
tjni Jul 21, 2023
84d5d2a
python310Packages.sphinxcontrib-spelling: no longer use pbr
tjni Jul 21, 2023
f6d8049
python310Packages.sphinxcontrib-tikz: remove *-nspkg.pth file
tjni Jul 21, 2023
40cf003
python310Packages.sphinxcontrib-websupport: remove *-nspkg.pth file
tjni Jul 21, 2023
f1ba2a1
python310Packages.sphinxcontrib-youtube: 1.2.0 -> 1.3.0
tjni Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkgs/applications/misc/khal/default.nix
Expand Up @@ -25,7 +25,7 @@ python3.pkgs.buildPythonApplication rec {
] ++ (with python3.pkgs; [
setuptools-scm
sphinx
sphinxcontrib_newsfeed
sphinxcontrib-newsfeed
]);

propagatedBuildInputs = with python3.pkgs;[
Expand Down Expand Up @@ -62,7 +62,7 @@ python3.pkgs.buildPythonApplication rec {
--fish <(_KHAL_COMPLETE=fish_source $out/bin/khal)

# man page
PATH="${python3.withPackages (ps: with ps; [ sphinx sphinxcontrib_newsfeed ])}/bin:$PATH" \
PATH="${python3.withPackages (ps: with ps; [ sphinx sphinxcontrib-newsfeed ])}/bin:$PATH" \
make -C doc man
installManPage doc/build/man/khal.1

Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/interpreters/python/hooks/default.nix
Expand Up @@ -184,6 +184,11 @@ in {
};
} ./setuptools-rust-hook.sh) {};

setuptoolsLegacyNamespaceHook = callPackage ({ makePythonHook }:
makePythonHook {
name = "setuptools-legacy-namespace-hook";
} ./setuptools-legacy-namespace-hook.sh) {};

unittestCheckHook = callPackage ({ makePythonHook }:
makePythonHook {
name = "unittest-check-hook";
Expand Down
@@ -0,0 +1,28 @@
# Setup hook for setuptools.
echo "Sourcing setuptools-legacy-namespace-hook"

setuptoolsLegacyNamespaceFixupPhase() {
echo "Executing setuptoolsLegacyNamespaceFixupPhase"

# We are going to delete every *-nspkg.pth file, which is generated by
# setuptools when a package uses the legacy namespace package code path
# (when using the namespace_packages keyword in setup.{cfg,py}).
#
# These files can cause subtle problems when used alongside packages that
# use a more modern code path that no longer generates those files. See:
#
# https://github.com/pypa/setuptools/discussions/3991
#
SETUPTOOLS_NSPKG_PTH_FILES="$(find "$out/lib" -type f -name '*-nspkg.pth')"
if [[ -n "$SETUPTOOLS_NSPKG_PTH_FILES" ]]; then
find "$out/lib" -type f -name '*-nspkg.pth' -delete
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
find "$out/lib" -type f -name '*-nspkg.pth' -delete
rm $SETUPTOOLS_NSPKG_PTH_FILES

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling find twice is less efficient, but I did it on purpose just in case the hook finds more than one -nspkg.pth file. The second find call handles deletion properly even if there are spaces in the file name. I can also limit the code to only deleting the first file found, or leave a better comment. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we tell find to exit with an error if it can't find files and then delete them right away?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to get find to work that way from reading the man page and testing a few things locally.

else
echo "No nspkg.pth file is generated anymore. Please remove the setuptoolsLegacyNamespaceHook hook."
exit 1
fi

echo "Finished executing setuptoolsLegacyNamespaceFixupPhase"
}

echo "Using setuptoolsLegacyNamespaceFixupPhase"
preFixupPhases+=" setuptoolsLegacyNamespaceFixupPhase"

This file was deleted.

77 changes: 15 additions & 62 deletions pkgs/development/python-modules/sphinx/default.nix
Expand Up @@ -30,38 +30,38 @@

# check phase
, cython
, filelock
, html5lib
, pytestCheckHook
, typed-ast
}:

buildPythonPackage rec {
pname = "sphinx";
version = "5.3.0";
version = "7.0.1";
format = "pyproject";

disabled = pythonOlder "3.6";
disabled = pythonOlder "3.8";

src = fetchFromGitHub {
owner = "sphinx-doc";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-80bVg1rfBebgSOKbWkzP84vpm39iLgM8lWlVD64nSsQ=";
postFetch = ''
cd $out
mv tests/roots/test-images/testimäge.png \
tests/roots/test-images/testimæge.png
patch -p1 < ${./0001-test-images-Use-normalization-equivalent-character.patch}
# Change ä to æ in file names, since ä can be encoded multiple ways on different
# filesystems, leading to different hashes on different platforms.
cd "$out";
mv tests/roots/test-images/{testimäge,testimæge}.png
sed -i 's/testimäge/testimæge/g' tests/{test_build*.py,roots/test-images/index.rst}
'';
hash = "sha256-DUUdHvmuxWw06ycH6qFE2LZ9GTzOqdvdPnye8cvVBOQ=";
};

nativeBuildInputs = [
flit-core
];

propagatedBuildInputs = [
babel
alabaster
babel
docutils
imagesize
jinja2
Expand All @@ -84,67 +84,20 @@ buildPythonPackage rec {
importlib-metadata
];

__darwinAllowLocalNetworking = true;

nativeCheckInputs = [
cython
filelock
html5lib
pytestCheckHook
] ++ lib.optionals (pythonOlder "3.8") [
typed-ast
];

preCheck = ''
export HOME=$(mktemp -d)
export HOME=$TMPDIR
'';

disabledTests = [
# requires network access
"test_anchors_ignored"
"test_defaults"
"test_defaults_json"
"test_latex_images"

# requires imagemagick (increases build closure size), doesn't
# test anything substantial
"test_ext_imgconverter"

# fails with pygments 2.14
# TODO remove for sphinx 6
"test_viewcode"
"test_additional_targets_should_be_translated"
"test_additional_targets_should_not_be_translated"

# sphinx.errors.VersionRequirementError: The alabaster extension
# used by this project needs at least Sphinx v1.6; it therefore
# cannot be built with this version.
"test_needs_sphinx"

# Likely due to pygments 2.14 update
# AssertionError: assert '5:11:17\u202fAM' == '5:11:17 AM'
"test_format_date"
] ++ lib.optionals stdenv.isDarwin [
# Due to lack of network sandboxing can't guarantee port 7777 isn't bound
"test_inspect_main_url"
"test_auth_header_uses_first_match"
"test_linkcheck_allowed_redirects"
"test_linkcheck_request_headers"
"test_linkcheck_request_headers_no_slash"
"test_follows_redirects_on_HEAD"
"test_get_after_head_raises_connection_error"
"test_invalid_ssl"
"test_connect_to_selfsigned_with_tls_verify_false"
"test_connect_to_selfsigned_with_tls_cacerts"
"test_connect_to_selfsigned_with_requests_env_var"
"test_connect_to_selfsigned_nonexistent_cert_file"
"test_TooManyRedirects_on_HEAD"
"test_too_many_requests_retry_after_int_del"
"test_too_many_requests_retry_after_HTTP_date"
"test_too_many_requests_retry_after_without_header"
"test_too_many_requests_user_timeout"
"test_raises_for_invalid_status"
"test_auth_header_no_match"
"test_follows_redirects_on_GET"
"test_connect_to_selfsigned_fails"
] ++ lib.optionals isPyPy [
disabledTests = lib.optionals isPyPy [
# PyPy has not __builtins__ which get asserted
# https://doc.pypy.org/en/latest/cpython_differences.html#miscellaneous
"test_autosummary_generate_content_for_module"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expand Down
@@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptoolsLegacyNamespaceHook
, sphinx
, actdiag
, blockdiag
Expand All @@ -19,6 +20,10 @@ buildPythonPackage rec {
hash = "sha256-PFXUVP/Due/nwg8q2vAiGZuCVhLTLyAL6KSXqofg+B8=";
};

nativeBuildInputs = [
setuptoolsLegacyNamespaceHook
];

propagatedBuildInputs = [
actdiag
blockdiag
Expand Down
@@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptoolsLegacyNamespaceHook
, pbr
}:

Expand All @@ -18,6 +19,10 @@ buildPythonPackage rec {
rm test-requirements.txt requirements.txt
'';

nativeBuildInputs = [
setuptoolsLegacyNamespaceHook
];

propagatedBuildInputs = [
pbr
];
Expand Down
@@ -1,19 +1,23 @@
{ lib
, buildPythonPackage
, fetchPypi
, isPy27
, setuptools
}:

buildPythonPackage rec {
pname = "sphinxcontrib-applehelp";
version = "1.0.2";
disabled = isPy27;
version = "1.0.4";
format = "pyproject";

src = fetchPypi {
inherit pname version;
sha256 = "a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58";
hash = "sha256-go+GeUW745gXwhChq/0bxIlci3P8qt5W1FNXo0igfX4=";
};

nativeBuildInputs = [
setuptools
];

# Check is disabled due to circular dependency of sphinx
doCheck = false;

Expand Down
@@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptoolsLegacyNamespaceHook
, sphinx
, sphinxcontrib-tikz
}:
Expand All @@ -15,6 +16,10 @@ buildPythonPackage rec {
hash = "sha256-+M+K8WzQqxQUGgAgGPK+isf3gKK7HOrdI6nNW/V8Wv0=";
};

nativeBuildInputs = [
setuptoolsLegacyNamespaceHook
];

propagatedBuildInputs = [ sphinx sphinxcontrib-tikz ];

# No tests
Expand Down
Expand Up @@ -2,6 +2,7 @@
, buildPythonPackage
, fetchPypi
, pythonOlder
, setuptoolsLegacyNamespaceHook
, oset
, pybtex
, pybtex-docutils
Expand All @@ -11,6 +12,7 @@
buildPythonPackage rec {
pname = "sphinxcontrib-bibtex";
version = "2.5.0";
format = "setuptools";

disabled = pythonOlder "3.6";

Expand All @@ -19,6 +21,10 @@ buildPythonPackage rec {
hash = "sha256-cbQuXbDi4oTyQ4dTJr+ZNqqadjKCJ311BIgm/vWwDqo=";
};

nativeBuildInputs = [
setuptoolsLegacyNamespaceHook
];

propagatedBuildInputs = [
oset
pybtex
Expand Down
@@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptoolsLegacyNamespaceHook
, unittestCheckHook
, mock
, sphinx-testing
Expand All @@ -11,12 +12,17 @@
buildPythonPackage rec {
pname = "sphinxcontrib-blockdiag";
version = "3.0.0";
format = "setuptools";

src = fetchPypi {
inherit pname version;
sha256 = "aa49bf924516f5de8a479994c7be81e077df5599c9da2a082003d5b388e1d450";
hash = "sha256-qkm/kkUW9d6KR5mUx76B4HffVZnJ2ioIIAPVs4jh1FA=";
};

nativeBuildInputs = [
setuptoolsLegacyNamespaceHook
];

buildInputs = [ mock sphinx-testing ];
propagatedBuildInputs = [ sphinx blockdiag ];

Expand All @@ -33,5 +39,4 @@ buildPythonPackage rec {
maintainers = with maintainers; [ ];
license = licenses.bsd2;
};

}
@@ -1,26 +1,29 @@
{ lib
, buildPythonPackage
, fetchPypi
, docutils
, flit-core
, sphinx
, requests
, jinja2
}:

buildPythonPackage rec {
pname = "sphinxcontrib-confluencebuilder";
version = "2.0.0";
version = "2.1.1";
format = "pyproject";

src = fetchPypi {
inherit pname version;
hash = "sha256-RyShQt/t8tnE5ZHM0WDQ+jrvXem3y24tCpj3s6Thq+g=";
pname = "sphinxcontrib_confluencebuilder";
inherit version;
hash = "sha256-+gan96ZtaPsb5VBH3UFlSVqsHHZVIAEaijGxoQmCdQI=";
};

nativeBuildInputs = [
flit-core
];

propagatedBuildInputs = [
docutils
sphinx
requests
jinja2
];

# Tests are disabled due to a circular dependency on Sphinx
Expand Down