Skip to content

Commit 18170b0

Browse files
author
Johannes Drever
committed
update
1 parent 5e7b223 commit 18170b0

File tree

11 files changed

+210
-8
lines changed

11 files changed

+210
-8
lines changed

.venv/bin/python

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python3.7

.venv/bin/python3

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python3.7

.venv/bin/python3.7

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/nix/store/mmqp693fa9aw6qw12r6s7qwx2j97bnrj-python3-3.7.9-env/bin/python3.7

.venv/pyvenv.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
home = /nix/store/mmqp693fa9aw6qw12r6s7qwx2j97bnrj-python3-3.7.9-env/bin
2+
include-system-site-packages = false
3+
version = 3.7.9

TODO.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[ ] ist corona-tracker-api eine library oder eine application?
2+
3+
[ ] wie kann ich python packages auf versionen fest machen?
4+
[ ] python packages
5+
[ ] aiocache[redis]
6+
[ ] asyncache
7+
[ ] attrs 19.3.0
8+
9+

default.nix

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1-
let
2-
pkgs = import <nixpkgs> {};
3-
python-packages = python-packages: with python-packages; [
4-
aiofiles
5-
];
6-
in
7-
pkgs.python37.withPackages python-packages
1+
{ lib, buildPythonPackage, fetchFromGitHub }:
2+
3+
buildPythonPackage rec {
4+
pname = "coronavirus-tracker-api";
5+
version = "0.2.X";
6+
7+
src = fetchFromGitHub {
8+
owner = "ExpDev07";
9+
repo = "coronavirus-tracker-api";
10+
rev = "348628d046947fe38897c38c8ca1c7948b5228a5";
11+
sha256 = "1ce8d7686dadb75c95372f74c4765dbc755bab0f";
12+
};
13+
14+
doCheck = false;
15+
16+
meta = with lib; {
17+
homepage = "https://github.com/ExpDev07/coronavirus-tracker-api";
18+
description = "Provides up-to-date data about Coronavirus outbreak. Includes numbers about confirmed cases, deaths and recovered. Support multiple data-sources.";
19+
license = licenses.gpl3;
20+
maintainers = with maintainers; [ drever ];
21+
};
22+
}

release.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
let
2+
pkgs = import ../nixpkgs {};
3+
python = pkgs.python37;
4+
coronavirus-tracker-api = ./default.nix;
5+
python-packages = python-packages: with python-packages; [
6+
aiofiles
7+
aiohttp
8+
aioredis
9+
asgiref
10+
async-timeout
11+
asyncache
12+
attrs
13+
cachetools
14+
certifi
15+
cffi
16+
chardet
17+
click
18+
cryptography
19+
# dataclasses - We are using python37 which has dataclasses included
20+
# fastapi - error: wasmer-1.0.0-beta1 not supported for interpreter python3.7
21+
gunicorn
22+
h11
23+
hiredis
24+
httptools
25+
idna-ssl
26+
idna
27+
multidict
28+
psutil
29+
pycparser
30+
# pydantic[dotenv] - pyenv is used to switch python version. Crossing fingers that it is not needed
31+
pyopenssl
32+
python-dateutil
33+
python-dotenv
34+
requests
35+
# scout-apm - error: wasmer-1.0.0-beta1 not supported for interpreter python3.7
36+
sentry-sdk
37+
six
38+
# starlette - error: wasmer-1.0.0-beta1 not supported for interpreter python3.7
39+
# urllib3[secure]
40+
uvicorn
41+
uvloop
42+
websockets
43+
wrapt
44+
yarl
45+
46+
coronavirus-tracker-api
47+
];
48+
in
49+
python.withPackages python-packages
50+

requirements.nix

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# generated using pypi2nix tool (version: 2.0.4)
2+
# See more at: https://github.com/nix-community/pypi2nix
3+
#
4+
# COMMAND:
5+
# pypi2nix -e pydantic
6+
#
7+
8+
{ pkgs ? import <nixpkgs> {},
9+
overrides ? ({ pkgs, python }: self: super: {})
10+
}:
11+
12+
let
13+
14+
inherit (pkgs) makeWrapper;
15+
inherit (pkgs.stdenv.lib) fix' extends inNixShell;
16+
17+
pythonPackages =
18+
import "${toString pkgs.path}/pkgs/top-level/python-packages.nix" {
19+
inherit pkgs;
20+
inherit (pkgs) stdenv;
21+
python = pkgs.python3;
22+
};
23+
24+
commonBuildInputs = [];
25+
commonDoCheck = false;
26+
27+
withPackages = pkgs':
28+
let
29+
pkgs = builtins.removeAttrs pkgs' ["__unfix__"];
30+
interpreterWithPackages = selectPkgsFn: pythonPackages.buildPythonPackage {
31+
name = "python3-interpreter";
32+
buildInputs = [ makeWrapper ] ++ (selectPkgsFn pkgs);
33+
buildCommand = ''
34+
mkdir -p $out/bin
35+
ln -s ${pythonPackages.python.interpreter} \
36+
$out/bin/${pythonPackages.python.executable}
37+
for dep in ${builtins.concatStringsSep " "
38+
(selectPkgsFn pkgs)}; do
39+
if [ -d "$dep/bin" ]; then
40+
for prog in "$dep/bin/"*; do
41+
if [ -x "$prog" ] && [ -f "$prog" ]; then
42+
ln -s $prog $out/bin/`basename $prog`
43+
fi
44+
done
45+
fi
46+
done
47+
for prog in "$out/bin/"*; do
48+
wrapProgram "$prog" --prefix PYTHONPATH : "$PYTHONPATH"
49+
done
50+
pushd $out/bin
51+
ln -s ${pythonPackages.python.executable} python
52+
ln -s ${pythonPackages.python.executable} \
53+
python3
54+
popd
55+
'';
56+
passthru.interpreter = pythonPackages.python;
57+
};
58+
59+
interpreter = interpreterWithPackages builtins.attrValues;
60+
in {
61+
__old = pythonPackages;
62+
inherit interpreter;
63+
inherit interpreterWithPackages;
64+
mkDerivation = args: pythonPackages.buildPythonPackage (args // {
65+
nativeBuildInputs = (args.nativeBuildInputs or []) ++ args.buildInputs;
66+
});
67+
packages = pkgs;
68+
overrideDerivation = drv: f:
69+
pythonPackages.buildPythonPackage (
70+
drv.drvAttrs // f drv.drvAttrs // { meta = drv.meta; }
71+
);
72+
withPackages = pkgs'':
73+
withPackages (pkgs // pkgs'');
74+
};
75+
76+
python = withPackages {};
77+
78+
generated = self: {
79+
"pydantic" = python.mkDerivation {
80+
name = "pydantic-1.7.3";
81+
src = pkgs.fetchurl {
82+
url = "https://files.pythonhosted.org/packages/67/da/955ec31a0c8989da0926192bf08e30359fb3f15ed2fab1bc2ced87d7bd76/pydantic-1.7.3.tar.gz";
83+
sha256 = "213125b7e9e64713d16d988d10997dabc6a1f73f3991e1ff8e35ebb1409c7dc9";
84+
};
85+
doCheck = commonDoCheck;
86+
format = "setuptools";
87+
buildInputs = commonBuildInputs ++ [
88+
89+
];
90+
propagatedBuildInputs = [ ];
91+
meta = with pkgs.stdenv.lib; {
92+
homepage = "https://github.com/samuelcolvin/pydantic";
93+
license = licenses.mit;
94+
description = "Data validation and settings management using python 3.6 type hinting";
95+
};
96+
};
97+
};
98+
localOverridesFile = ./requirements_override.nix;
99+
localOverrides = import localOverridesFile { inherit pkgs python; };
100+
commonOverrides = [
101+
(let src = pkgs.fetchFromGitHub { owner = "nix-community"; repo = "pypi2nix-overrides"; rev = "90e891e83ffd9e55917c48d24624454620d112f0"; sha256 = "0cl1r3sxibgn1ks9xyf5n3rdawq4hlcw4n6xfhg3s1kknz54jp9y"; } ; in import "${src}/overrides.nix" { inherit pkgs python; })
102+
];
103+
paramOverrides = [
104+
(overrides { inherit pkgs python; })
105+
];
106+
allOverrides =
107+
(if (builtins.pathExists localOverridesFile)
108+
then [localOverrides] else [] ) ++ commonOverrides ++ paramOverrides;
109+
110+
in python.withPackages
111+
(fix' (pkgs.lib.fold
112+
extends
113+
generated
114+
allOverrides
115+
)
116+
)

requirements_frozen.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pydantic==1.7.3

requirements_override.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{ pkgs, python }:
2+
3+
self: super: {
4+
5+
}

0 commit comments

Comments
 (0)