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 16 commits into
base: main
Choose a base branch
from
27 changes: 10 additions & 17 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 @@ -49,14 +49,7 @@ jobs:

- name: Install dvc requirements
run: |
# available lxml (webdav dependency) wheels are built with an old
# 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 ./dvc[all] PyInstaller==6.11.1
dvc doctor

- name: Build binary
Expand All @@ -81,10 +74,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 +136,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 +170,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 All @@ -205,7 +198,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Slack Notification
uses: rtCamp/[email protected].1
uses: rtCamp/[email protected].2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Send message to slack
if: failure()
uses: rtCamp/[email protected].1
uses: rtCamp/[email protected].2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: ${{ job.status }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.7.0'
rev: 'v0.7.2'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
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")
2 changes: 1 addition & 1 deletion download.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import git

VERSION = "3.55.2"
VERSION = "3.59.0"
URL = "https://github.com/iterative/dvc"

path = pathlib.Path(__file__).parent.absolute()
Expand Down
Loading