Skip to content

Commit dd8ecb3

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

File tree

4 files changed

+151
-15
lines changed

4 files changed

+151
-15
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: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@
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+
# For https://github.com/readthedocs/sphinx_rtd_theme/pull/1185, otherwise lists are broken locally
71+
sphinx_rtd_theme = {
72+
url = "github:readthedocs/sphinx_rtd_theme?rev=34f81daaf52466366c80003db293d50075c1b896";
73+
flake = false;
74+
};
75+
poetry2nix.url = "github:nix-community/poetry2nix/master";
6676
};
6777
outputs =
6878
inputs@{ self, nixpkgs, flake-compat, flake-utils, pre-commit-hooks, gitignore, ... }:
@@ -169,7 +179,7 @@
169179
let
170180
pkgs = import nixpkgs {
171181
inherit system;
172-
overlays = [ self.overlay ];
182+
overlays = [ self.overlay inputs.poetry2nix.overlay ];
173183
config = { allowBroken = true; };
174184
};
175185

@@ -217,16 +227,23 @@
217227
ghc922 = ghc922Config.tweakHpkgs (pkgs.hlsHpkgs "ghc922");
218228

219229
# 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-
});
230+
myst-parser = pkgs.poetry2nix.mkPoetryEnv {
231+
projectDir = inputs.myst-parser;
232+
python = pkgs.python39;
233+
overrides = [
234+
pkgs.poetry2nix.defaultPoetryOverrides
235+
];
236+
};
237+
sphinx_rtd_theme = pkgs.poetry2nix.mkPoetryEnv {
238+
projectDir = inputs.sphinx_rtd_theme;
239+
python = pkgs.python39;
240+
overrides = [
241+
pkgs.poetry2nix.defaultPoetryOverrides
242+
(self: super: {
243+
docutils = pkgs.python3Packages.callPackage ./docutils.nix {};
244+
})
245+
];
246+
};
230247
pythonWithPackages = pkgs.python3.withPackages (ps: [ps.sphinx myst-parser sphinx_rtd_theme ps.pip]);
231248

232249
docs = pkgs.stdenv.mkDerivation {
@@ -377,7 +394,7 @@
377394

378395
defaultPackage = packages.haskell-language-server;
379396

380-
devShell = devShells.haskell-language-server-dev;
397+
devShell = devShells.haskell-language-server-922-dev;
381398
});
382399

383400
nixConfig = {

0 commit comments

Comments
 (0)