Skip to content

Commit b0cc8ec

Browse files
authored
Merge pull request #48 from kluctl/fix-extract
Upgrade Python versions and fix locking issues
2 parents 4254fbe + ba6e643 commit b0cc8ec

File tree

7 files changed

+50
-56
lines changed

7 files changed

+50
-56
lines changed

.github/workflows/release.yml

+14-23
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ on:
1111
env:
1212
PYTHON_STANDALONE_VERSIONS: |
1313
[
14-
"20240415"
14+
"20241219"
1515
]
1616
PYTHON_VERSIONS: |
1717
[
18-
"3.10.14",
19-
"3.11.9",
20-
"3.12.3"
18+
"3.10.16",
19+
"3.11.11",
20+
"3.12.8",
21+
"3.13.1",
2122
]
2223
2324
jobs:
@@ -61,14 +62,6 @@ jobs:
6162
uses: actions/setup-go@v5
6263
with:
6364
go-version: 1.19
64-
- uses: actions/cache@v4
65-
with:
66-
path: |
67-
~/go/pkg/mod
68-
~/.cache/go-build
69-
key: ${{ runner.os }}-${{ matrix.pythonStandaloneVersion }}-${{ matrix.pythonVersion }}-build-tag-${{ hashFiles('**/go.sum') }}
70-
restore-keys: |
71-
${{ runner.os }}-${{ matrix.pythonStandaloneVersion }}-${{ matrix.pythonVersion }}-build-tag-
7265
- name: build-tag
7366
run: |
7467
git config --global user.email "[email protected]"
@@ -79,11 +72,14 @@ jobs:
7972
- name: git gc
8073
run: |
8174
git gc
75+
- name: rename .git
76+
run: |
77+
mv .git git-dir
8278
- uses: actions/upload-artifact@v4
8379
with:
8480
name: workdir-${{ matrix.pythonStandaloneVersion }} ${{ matrix.pythonVersion }}
8581
path: |
86-
.git
82+
git-dir
8783
build-num
8884
8985
tests:
@@ -94,8 +90,8 @@ jobs:
9490
matrix:
9591
os:
9692
- ubuntu-22.04
97-
- macos-12
98-
- windows-2019
93+
- macos-13
94+
- windows-2022
9995
pythonStandaloneVersion: ${{ fromJSON(needs.build-matrix.outputs.PYTHON_STANDALONE_VERSIONS) }}
10096
pythonVersion: ${{ fromJSON(needs.build-matrix.outputs.PYTHON_VERSIONS) }}
10197
fail-fast: false
@@ -105,17 +101,12 @@ jobs:
105101
uses: actions/setup-go@v5
106102
with:
107103
go-version: 1.19
108-
- uses: actions/cache@v4
109-
with:
110-
path: |
111-
~/go/pkg/mod
112-
~/.cache/go-build
113-
key: ${{ runner.os }}-${{ matrix.pythonStandaloneVersion }}-${{ matrix.pythonVersion }}-tests-${{ hashFiles('**/go.sum') }}
114-
restore-keys: |
115-
${{ runner.os }}-${{ matrix.pythonStandaloneVersion }}-${{ matrix.pythonVersion }}-tests-
116104
- uses: actions/download-artifact@v4
117105
with:
118106
name: workdir-${{ matrix.pythonStandaloneVersion }} ${{ matrix.pythonVersion }}
107+
- name: rename .git back
108+
run: |
109+
mv git-dir .git
119110
- name: checkout tag
120111
shell: bash
121112
run: |

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ The following operating systems and architectures are supported:
4545
Releases in this library are handled a bit different from what one might be used to. This library does currently not
4646
follow a versioning schema comparable to sematic versioning. This might however change in the future.
4747

48-
Right now, every tagged release is compromised of the Python interpreter version, the [python-standalone](https://github.com/indygreg/python-build-standalone)
49-
and a build number. For example, the release version `v0.0.0-3.11.6-20231002-2` belongs to Python version 3.11.6,
50-
the [20231002](https://github.com/indygreg/python-build-standalone/releases/tag/20231002) version of python-standalone
48+
Right now, every tagged release is compromised of the Python interpreter version, the [python-standalone](https://github.com/astral-sh/python-build-standalone)
49+
and a build number. For example, the release version `v0.0.0-3.11.6-20241219-2` belongs to Python version 3.11.6,
50+
the [20241219](https://github.com/astral-sh/python-build-standalone/releases/tag/20241219) version of python-standalone
5151
and build number 2. The release version currently always has v0.0.0 as its own version.
5252

5353
The way versioning is handled might result in popular dependency management tools (e.g. dependabot) to not work as you
5454
might require it. Please watch out to not accidentally upgrade your Python version!
5555

5656
## How it works
57-
This library uses the standalone Python distributions found at https://github.com/indygreg/python-build-standalone as
57+
This library uses the standalone Python distributions found at https://github.com/astral-sh/python-build-standalone as
5858
the base.
5959

6060
The `./hack/build-tag.sh` script is used to invoke `python/generate` and `pip/generate`, which then downloads, extracts

embed_util/embedded_files.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"compress/gzip"
66
"fmt"
7-
"github.com/rogpeppe/go-internal/lockedfile"
7+
"github.com/gofrs/flock"
88
"io"
99
"io/fs"
1010
"os"
@@ -63,7 +63,8 @@ func (e *EmbeddedFiles) extract(embedFs fs.FS, withHashInDir bool) error {
6363
return err
6464
}
6565

66-
lock, err := lockedfile.Create(e.extractedPath + ".lock")
66+
lock := flock.New(e.extractedPath + ".lock")
67+
err = lock.Lock()
6768
if err != nil {
6869
return err
6970
}

go.mod

+7-5
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ go 1.19
44

55
require (
66
github.com/gobwas/glob v0.2.3
7-
github.com/klauspost/compress v1.17.9
8-
github.com/rogpeppe/go-internal v1.12.0
7+
github.com/gofrs/flock v0.12.1
8+
github.com/klauspost/compress v1.17.11
99
github.com/sirupsen/logrus v1.9.3
10-
github.com/stretchr/testify v1.9.0
11-
golang.org/x/sync v0.7.0
10+
github.com/stretchr/testify v1.10.0
11+
golang.org/x/sync v0.10.0
1212
)
1313

1414
require (
1515
github.com/davecgh/go-spew v1.1.1 // indirect
16+
github.com/kr/text v0.2.0 // indirect
1617
github.com/pmezard/go-difflib v1.0.0 // indirect
17-
golang.org/x/sys v0.21.0 // indirect
18+
github.com/rogpeppe/go-internal v1.13.1 // indirect
19+
golang.org/x/sys v0.28.0 // indirect
1820
gopkg.in/yaml.v3 v3.0.1 // indirect
1921
)

go.sum

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
12
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
23
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
34
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
45
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
56
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
6-
github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
7-
github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
8-
github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
9-
github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
10-
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
11-
github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
7+
github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E=
8+
github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0=
9+
github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc=
10+
github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0=
11+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
12+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
13+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
14+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
1215
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1316
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
14-
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
15-
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
17+
github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII=
18+
github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o=
1619
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
1720
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
1821
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1922
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
20-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
21-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
22-
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
23-
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
24-
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
25-
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
23+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
24+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
25+
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
26+
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
2627
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
27-
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
28-
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
29-
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
30-
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
31-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
28+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
29+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
3230
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
31+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
32+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
3333
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
3434
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
3535
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

pip/internal/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pip==23.3.1
1+
pip==24.3.1

python/generate/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
)
1818

1919
var (
20-
pythonStandaloneVersion = flag.String("python-standalone-version", "", "specify the python-standalone version. Check https://github.com/indygreg/python-build-standalone/releases/ for available options.")
20+
pythonStandaloneVersion = flag.String("python-standalone-version", "", "specify the python-standalone version. Check https://github.com/astral-sh/python-build-standalone/releases/ for available options.")
2121
pythonVersion = flag.String("python-version", "", "specify the python version.")
2222
preparePath = flag.String("prepare-path", filepath.Join(os.TempDir(), "python-download"), "specify the path where the python executables are downloaded and prepared. automatically creates a temporary directory if unset")
2323
runPrepare = flag.Bool("prepare", true, "if set, python executables will be downloaded and prepared for packing at the configured path")
@@ -173,7 +173,7 @@ func download(osName string, arch string, dist string) string {
173173

174174
downloadPath := generateDownloadPath(arch, dist)
175175
fname := filepath.Base(downloadPath)
176-
downloadUrl := fmt.Sprintf("https://github.com/indygreg/python-build-standalone/releases/download/%s/%s", *pythonStandaloneVersion, fname)
176+
downloadUrl := fmt.Sprintf("https://github.com/astral-sh/python-build-standalone/releases/download/%s/%s", *pythonStandaloneVersion, fname)
177177

178178
if _, err := os.Stat(downloadPath); err == nil {
179179
log.Infof("skipping download of %s", downloadUrl)

0 commit comments

Comments
 (0)