Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build pkg with Python 3.12 #236

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install app certificates
env:
Expand Down Expand Up @@ -53,10 +53,7 @@ jobs:
# SDK, which breaks osxpkg notarization. Building from scratch
# instead.
pip install ./dvc[all] --no-binary lxml
# https://github.com/iterative/dvc/issues/7949
pip install PyInstaller==6.9.0
# https://github.com/iterative/dvc/issues/9654
pip install flufl-lock==7.1.1
pip install PyInstaller==6.11.0
dvc doctor

- name: Build binary
Expand All @@ -81,10 +78,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
Expand Down Expand Up @@ -143,10 +140,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install requirements
run: |
Expand Down Expand Up @@ -177,10 +174,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"

- name: Install requirements
run: pip install awscli
Expand Down
63 changes: 34 additions & 29 deletions build_installer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import pathlib
import shutil
from subprocess import STDOUT, check_call, check_output
Expand Down Expand Up @@ -39,36 +40,40 @@

lib = install / "lib"
lib.mkdir(parents=True)
shutil.copytree(path / "dist" / "dvc", lib / "dvc")

bash_dir.mkdir(parents=True)
bash_completion = check_output(
[lib / "dvc" / "dvc", "completion", "-s", "bash"], text=True
)
(bash_dir / "dvc").write_text(bash_completion)
try:
os.rename(path / "dist" / "dvc", lib / "dvc")

zsh_dir = install / "share" / "zsh" / "site-functions"
zsh_dir.mkdir(parents=True)
zsh_completion = check_output(
[lib / "dvc" / "dvc", "completion", "-s", "zsh"], text=True
)
(zsh_dir / "_dvc").write_text(zsh_completion)
bash_dir.mkdir(parents=True)
bash_completion = check_output(
[lib / "dvc" / "dvc", "completion", "-s", "bash"], text=True
)
(bash_dir / "dvc").write_text(bash_completion)

version = check_output([lib / "dvc" / "dvc", "--version"], text=True).strip()
zsh_dir = install / "share" / "zsh" / "site-functions"
zsh_dir.mkdir(parents=True)
zsh_completion = check_output(
[lib / "dvc" / "dvc", "completion", "-s", "zsh"], text=True
)
(zsh_dir / "_dvc").write_text(zsh_completion)

check_call(
[
"fpm",
"--verbose",
"-t",
"osxpkg",
*flags,
"-v",
version,
"-C",
build,
*dirs,
],
cwd=path,
stderr=STDOUT,
)
version = check_output([lib / "dvc" / "dvc", "--version"], text=True).strip()

check_call(
[
"fpm",
"--verbose",
"-t",
"osxpkg",
*flags,
"-v",
version,
"-C",
build,
*dirs,
],
cwd=path,
stderr=STDOUT,
)
finally:
os.rename(lib / "dvc", path / "dist" / "dvc")
Loading