Skip to content

Commit 2a63c0c

Browse files
committed
myst-parser: bump docutils version requirements
1 parent b1c3a38 commit 2a63c0c

File tree

4 files changed

+153
-14
lines changed

4 files changed

+153
-14
lines changed

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Sphinx==4.0.2
22
sphinx-rtd-theme==0.5.2
33
myst-parser==0.15.1
4-
docutils<0.17
4+
docutils<0.19

docutils.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{ stdenv, lib, fetchPypi, buildPythonPackage, isPy3k, python }:
2+
3+
buildPythonPackage rec {
4+
pname = "docutils";
5+
version = "0.17.1";
6+
7+
src = fetchPypi {
8+
inherit pname version;
9+
sha256 = "686577d2e4c32380bb50cbb22f575ed742d58168cee37e99117a854bcd88f125";
10+
};
11+
12+
# Only Darwin needs LANG, but we could set it in general.
13+
# It's done here conditionally to prevent mass-rebuilds.
14+
checkPhase = lib.optionalString (isPy3k && stdenv.isDarwin)
15+
''LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" '' + ''
16+
${python.interpreter} test/alltests.py
17+
'';
18+
19+
# Create symlinks lacking a ".py" suffix, many programs depend on these names
20+
postFixup = ''
21+
for f in $out/bin/*.py; do
22+
ln -s $(basename $f) $out/bin/$(basename $f .py)
23+
done
24+
'';
25+
26+
meta = with lib; {
27+
description = "Python Documentation Utilities";
28+
homepage = "http://docutils.sourceforge.net/";
29+
license = with licenses; [ publicDomain bsd2 psfl gpl3Plus ];
30+
maintainers = with maintainers; [ AndersonTorres ];
31+
};
32+
}

flake.lock

Lines changed: 89 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@
6363
url = "https://hackage.haskell.org/package/hie-bios-0.9.1/hie-bios-0.9.1.tar.gz";
6464
flake = false;
6565
};
66+
myst-parser = {
67+
url = "github:smunix/MyST-Parser?ref=fix.hls-docutils";
68+
flake = false;
69+
};
70+
sphinx_rtd_theme = {
71+
url = "github:readthedocs/sphinx_rtd_theme?rev=34f81daaf52466366c80003db293d50075c1b896";
72+
flake = false;
73+
};
74+
poetry2nix.url = "github:nix-community/poetry2nix/master";
6675
};
6776
outputs =
6877
inputs@{ self, nixpkgs, flake-compat, flake-utils, pre-commit-hooks, gitignore, ... }:
@@ -169,7 +178,7 @@
169178
let
170179
pkgs = import nixpkgs {
171180
inherit system;
172-
overlays = [ self.overlay ];
181+
overlays = [ self.overlay inputs.poetry2nix.overlay ];
173182
config = { allowBroken = true; };
174183
};
175184

@@ -217,16 +226,27 @@
217226
ghc922 = ghc922Config.tweakHpkgs (pkgs.hlsHpkgs "ghc922");
218227

219228
# For markdown support
220-
myst-parser = pkgs.python3Packages.callPackage ./myst-parser.nix {};
221-
sphinx_rtd_theme = pkgs.python3Packages.sphinx_rtd_theme.overrideAttrs (oldAttrs: {
222-
# For https://github.com/readthedocs/sphinx_rtd_theme/pull/1185, otherwise lists are broken locally
223-
src = pkgs.fetchFromGitHub {
224-
owner = "readthedocs";
225-
repo = "sphinx_rtd_theme";
226-
rev = "34f81daaf52466366c80003db293d50075c1b896";
227-
sha256 = "0rkrsvvqr6g2p3v5vq88jhfp5sd0r1jqjh3vc5y26jn30z8s4fkz";
228-
};
229-
});
229+
# myst-parser = (pkgs.python3Packages.callPackage ./myst-parser.nix {}).overrideAttrs (oldAttrs: { src = inputs.myst-parser; });
230+
myst-parser = pkgs.poetry2nix.mkPoetryEnv {
231+
projectDir = inputs.myst-parser;
232+
python = pkgs.python39;
233+
overrides = [
234+
pkgs.poetry2nix.defaultPoetryOverrides
235+
(self: super: {
236+
docutils = pkgs.python3Packages.callPackage ./docutils.nix {};
237+
})
238+
];
239+
};
240+
sphinx_rtd_theme = pkgs.poetry2nix.mkPoetryEnv {
241+
projectDir = inputs.sphinx_rtd_theme;
242+
python = pkgs.python39;
243+
overrides = [
244+
pkgs.poetry2nix.defaultPoetryOverrides
245+
(self: super: {
246+
docutils = pkgs.python3Packages.callPackage ./docutils.nix {};
247+
})
248+
];
249+
};
230250
pythonWithPackages = pkgs.python3.withPackages (ps: [ps.sphinx myst-parser sphinx_rtd_theme ps.pip]);
231251

232252
docs = pkgs.stdenv.mkDerivation {

0 commit comments

Comments
 (0)