Skip to content

Commit

Permalink
go.mod, bump go, python & numpy versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tebeka committed Oct 12, 2023
1 parent c6252b3 commit 5298eae
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 6 deletions.
2 changes: 2 additions & 0 deletions py-in-mem/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export CGO_CFLAGS="-I $(python -c 'import numpy; print(numpy.get_include())')"
export PYTHONPATH=${PWD}
6 changes: 6 additions & 0 deletions py-in-mem/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"C_Cpp.default.includePath": [
"/usr/include/python3.8",
"/home/miki/.venv/lib/python3.8/site-packages/numpy/core/include"
]
}
9 changes: 4 additions & 5 deletions py-in-mem/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM python:3.8-slim
FROM python:3.11-slim
RUN apt-get update && apt-get install -y curl gcc make pkg-config
RUN curl -LO https://golang.org/dl/go1.14.7.linux-amd64.tar.gz
RUN tar xz -C /opt -f go1.14.7.linux-amd64.tar.gz
RUN curl -LO https://golang.org/dl/go1.21.3.linux-amd64.tar.gz
RUN tar xz -C /opt -f go1.21.3.linux-amd64.tar.gz
ENV PATH="/opt/go/bin:${PATH}"
RUN python -m pip install --upgrade pip
RUN python -m pip install numpy~=1.19
RUN python -m pip install numpy~=1.26
WORKDIR /py-in-mem
COPY . .
RUN go mod init github.com/ardanlabs/python-go/pyinmem
RUN make test
11 changes: 11 additions & 0 deletions py-in-mem/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module py-in-mem

go 1.21.3

require github.com/stretchr/testify v1.8.4

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
10 changes: 10 additions & 0 deletions py-in-mem/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion py-in-mem/outliers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

/*
#cgo pkg-config: python3
#cgo LDFLAGS: -lpython3.8
#cgo LDFLAGS: -lpython3.11
#include "glue.h"
*/
Expand Down

0 comments on commit 5298eae

Please sign in to comment.