-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50c8fba
commit 0387b65
Showing
13 changed files
with
513 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# use https://github.com/nix-community/nix-direnv to load all tools needed to develop in the repository | ||
# $ cp .envrc.example .envrc | ||
# $ direnv allow . | ||
use flake --impure . | ||
|
||
# alternatively just use `nix develop` or `nix-shell` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Nix Flake actions | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
|
||
jobs: | ||
nix-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v27 | ||
- id: set-matrix | ||
name: Generate Nix Matrix | ||
run: | | ||
set -Eeu | ||
matrix="$(nix eval --json '.#githubActions.matrix')" | ||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT" | ||
nix: | ||
needs: nix-matrix | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: ${{fromJSON(needs.nix-matrix.outputs.matrix)}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v27 | ||
- run: nix build -L '.#githubActions.checks.${{ matrix.attr }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ python, pkgs, ... }: | ||
python.pkgs.buildPythonPackage rec { | ||
name = "ddsketch"; | ||
version = "3.0.1"; | ||
|
||
src = pkgs.fetchFromGitHub { | ||
owner = "datadog"; | ||
repo = "sketches-py"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-SmdKq5aXi5B3FNBxPQDNKNBujGGEPXF132YGadGFPpo="; | ||
}; | ||
|
||
propagatedBuildInputs = with python.pkgs; [ | ||
six | ||
protobuf | ||
setuptools | ||
]; | ||
nativeBuildInputs = with python.pkgs; [ setuptools_scm ]; | ||
checkInputs = with python.pkgs; [ | ||
pytest | ||
numpy | ||
]; | ||
env.SETUPTOOLS_SCM_PRETEND_VERSION = version; | ||
|
||
pythonImportsCheck = [ "ddsketch" ]; | ||
|
||
postPatch = '' | ||
patchShebangs setup.py | ||
ls -lah | ||
echo version=\"${version}\" > ddsketch/__version.py | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
python, | ||
pkgs, | ||
ddsketch, | ||
... | ||
}: | ||
|
||
let | ||
envier = python.pkgs.buildPythonPackage rec { | ||
pname = "envier"; | ||
version = "0.5.2"; | ||
|
||
pyproject = true; | ||
propagatedBuildInputs = with python.pkgs; [ | ||
hatchling | ||
hatch-vcs | ||
]; | ||
|
||
src = pkgs.fetchPypi { | ||
inherit pname version; | ||
sha256 = "sha256-Tn45jLCajdNgUI734SURoVI1VCbSVEuEh6NNrSfMIK0="; | ||
}; | ||
}; | ||
|
||
ddtrace = python.pkgs.buildPythonPackage rec { | ||
pname = "ddtrace"; | ||
version = "2.9.2"; | ||
pyproject = true; | ||
|
||
nativeBuildInputs = | ||
[ pkgs.cmake ] | ||
++ (with python.pkgs; [ | ||
cmake | ||
setuptools | ||
setuptools_scm | ||
cython | ||
]) | ||
++ pkgs.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ]; | ||
|
||
propagatedBuildInputs = with python.pkgs; [ | ||
attrs | ||
cattrs | ||
ddsketch | ||
envier | ||
opentelemetry-api | ||
protobuf | ||
six | ||
xmltodict | ||
bytecode | ||
]; | ||
|
||
postPatch = '' | ||
substituteInPlace setup.py --replace "cmake>=3.24.2,<3.28" "cmake" | ||
# downloading artifacts is impossible in sandboxed build | ||
substituteInPlace setup.py --replace "cls.download_artifacts()" "pass" | ||
substituteInPlace pyproject.toml --replace "cmake>=3.24.2,<3.28" "cmake" | ||
''; | ||
|
||
dontUseCmakeConfigure = true; | ||
|
||
src = pkgs.fetchFromGitHub { | ||
owner = "datadog"; | ||
repo = "dd-trace-py"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-Ax220/uBNwSZNBFYxbxAe0rmLrqYYf3a8K/PIuSE150="; | ||
}; | ||
}; | ||
in | ||
(ddtrace) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.