mirror of
https://github.com/python-poetry/install.python-poetry.org.git
synced 2024-11-23 14:30:57 -05:00
Compare commits
9 commits
0b3b7109cc
...
91140fce28
Author | SHA1 | Date | |
---|---|---|---|
|
91140fce28 | ||
|
290e92f756 | ||
|
6dc43458ef | ||
|
d3ff39aaef | ||
|
c762e1bc54 | ||
|
89e0b6f7b9 | ||
|
f9ec0dc5c2 | ||
|
76183eebc8 | ||
|
a205673b4c |
4 changed files with 35 additions and 21 deletions
6
.github/dependabot.yml
vendored
Normal file
6
.github/dependabot.yml
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: monthly
|
19
.github/workflows/installer.yml
vendored
19
.github/workflows/installer.yml
vendored
|
@ -25,13 +25,16 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [Ubuntu, macOS, Windows]
|
os: [Ubuntu, macOS, Windows]
|
||||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
python-version:
|
||||||
|
- "3.9"
|
||||||
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
|
- "3.12"
|
||||||
|
- "3.13"
|
||||||
args:
|
args:
|
||||||
- ""
|
- ""
|
||||||
- "--preview"
|
- "--preview"
|
||||||
- "--git https://github.com/python-poetry/poetry.git"
|
- "--git https://github.com/python-poetry/poetry.git"
|
||||||
- "--version 1.1.15"
|
|
||||||
- "--version 1.2.0"
|
|
||||||
include:
|
include:
|
||||||
- os: Ubuntu
|
- os: Ubuntu
|
||||||
image: ubuntu-22.04
|
image: ubuntu-22.04
|
||||||
|
@ -44,10 +47,10 @@ jobs:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
@ -63,7 +66,7 @@ jobs:
|
||||||
run: python install-poetry.py -y ${{ matrix.args }}
|
run: python install-poetry.py -y ${{ matrix.args }}
|
||||||
|
|
||||||
- name: Upload Failure Log
|
- name: Upload Failure Log
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: poetry-installer-error.log
|
name: poetry-installer-error.log
|
||||||
|
@ -99,7 +102,7 @@ jobs:
|
||||||
run:
|
run:
|
||||||
shell: bash
|
shell: bash
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Packages
|
- name: Install Packages
|
||||||
run: |
|
run: |
|
||||||
|
@ -116,7 +119,7 @@ jobs:
|
||||||
run: python3 install-poetry.py -y
|
run: python3 install-poetry.py -y
|
||||||
|
|
||||||
- name: Upload Failure Log
|
- name: Upload Failure Log
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v4
|
||||||
if: failure()
|
if: failure()
|
||||||
with:
|
with:
|
||||||
name: poetry-installer-error.log
|
name: poetry-installer-error.log
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||||
rev: 23.9.1
|
rev: 24.10.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.4.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
@ -15,6 +15,6 @@ repos:
|
||||||
- id: check-json
|
- id: check-json
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.0.290
|
rev: v0.7.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
|
|
|
@ -22,7 +22,7 @@ installs, or use of pipx as alternatives to executing arbitrary, unversioned cod
|
||||||
script to alternatives, consider maintaining a local copy as part of your infrastructure.
|
script to alternatives, consider maintaining a local copy as part of your infrastructure.
|
||||||
|
|
||||||
For full documentation, visit https://python-poetry.org/docs/#installation.
|
For full documentation, visit https://python-poetry.org/docs/#installation.
|
||||||
""" # noqa: E501
|
"""
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
@ -557,14 +557,14 @@ class Installer:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.install(version)
|
new_windows_bin = self.install(version)
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
raise PoetryInstallationError(
|
raise PoetryInstallationError(
|
||||||
return_code=e.returncode, log=e.output.decode()
|
return_code=e.returncode, log=e.output.decode()
|
||||||
) from e
|
) from e
|
||||||
|
|
||||||
self._write("")
|
self._write("")
|
||||||
self.display_post_message(version)
|
self.display_post_message(version, new_windows_bin)
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
@ -584,7 +584,7 @@ class Installer:
|
||||||
self.version_file.write_text(version)
|
self.version_file.write_text(version)
|
||||||
self._install_comment(version, "Done")
|
self._install_comment(version, "Done")
|
||||||
|
|
||||||
return 0
|
return env.bin_path
|
||||||
|
|
||||||
def uninstall(self) -> int:
|
def uninstall(self) -> int:
|
||||||
if not self.data_dir.exists():
|
if not self.data_dir.exists():
|
||||||
|
@ -691,30 +691,35 @@ class Installer:
|
||||||
}
|
}
|
||||||
self._write(PRE_MESSAGE.format(**kwargs))
|
self._write(PRE_MESSAGE.format(**kwargs))
|
||||||
|
|
||||||
def display_post_message(self, version: str) -> None:
|
def display_post_message(self, version: str, new_windows_bin: str) -> None:
|
||||||
if WINDOWS:
|
if WINDOWS:
|
||||||
return self.display_post_message_windows(version)
|
return self.display_post_message_windows(version, new_windows_bin)
|
||||||
|
|
||||||
if SHELL == "fish":
|
if SHELL == "fish":
|
||||||
return self.display_post_message_fish(version)
|
return self.display_post_message_fish(version)
|
||||||
|
|
||||||
return self.display_post_message_unix(version)
|
return self.display_post_message_unix(version)
|
||||||
|
|
||||||
def display_post_message_windows(self, version: str) -> None:
|
def display_post_message_windows(self, version: str, new_windows_bin: str) -> None:
|
||||||
path = self.get_windows_path_var()
|
path = self.get_windows_path_var()
|
||||||
|
|
||||||
message = POST_MESSAGE_NOT_IN_PATH
|
message = POST_MESSAGE_NOT_IN_PATH
|
||||||
if path and str(self.bin_dir) in path:
|
if path and str(self.bin_dir) in path:
|
||||||
message = POST_MESSAGE
|
message = POST_MESSAGE
|
||||||
|
|
||||||
|
if new_windows_bin != self.bin_dir:
|
||||||
|
final_path = new_windows_bin
|
||||||
|
else:
|
||||||
|
final_path = self.bin_dir
|
||||||
|
|
||||||
self._write(
|
self._write(
|
||||||
message.format(
|
message.format(
|
||||||
poetry=colorize("info", "Poetry"),
|
poetry=colorize("info", "Poetry"),
|
||||||
version=colorize("b", version),
|
version=colorize("b", version),
|
||||||
poetry_home_bin=colorize("comment", self.bin_dir),
|
poetry_home_bin=colorize("comment", final_path),
|
||||||
poetry_executable=colorize("b", self.bin_dir.joinpath("poetry")),
|
poetry_executable=colorize("b", final_path.joinpath("poetry")),
|
||||||
configure_message=POST_MESSAGE_CONFIGURE_WINDOWS.format(
|
configure_message=POST_MESSAGE_CONFIGURE_WINDOWS.format(
|
||||||
poetry_home_bin=colorize("comment", self.bin_dir)
|
poetry_home_bin=colorize("comment", final_path)
|
||||||
),
|
),
|
||||||
test_command=colorize("b", "poetry --version"),
|
test_command=colorize("b", "poetry --version"),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue