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

Disable the progress bar when exec twine upload #231

Merged
merged 4 commits into from
May 16, 2024

Conversation

shenxianpeng
Copy link
Contributor

Closes #229. I looked at twine's help and added a new input no-color for this action.

twine --help
usage: twine [-h] [--version] [--no-color] {check,upload,register}

positional arguments:
  {check,upload,register}

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --no-color            disable colored output

@webknjaz
Copy link
Member

The CI doesn't test this case, which is necessary to ensure this keeps working over time. Also, it might make sense to just do this unconditionally.

@webknjaz
Copy link
Member

So let's see if the output is good enough to avoid exposing another API toggle to the end-users.

@shenxianpeng
Copy link
Contributor Author

shenxianpeng commented Apr 22, 2024

Also, it might make sense to just do this unconditionally.

OK. I'll leave it on by default, this time could be as a test.

@webknjaz
Copy link
Member

The CI run is now approved, let's see..

@webknjaz
Copy link
Member

Looks like the lockfile needs updating.

@shenxianpeng
Copy link
Contributor Author

I retried the option --no-color from my local, the right command should be twine --no-color upload dist/* not twine upload --no-color dist/*, I hope I can adjust --no-color before upload.

@shenxianpeng
Copy link
Contributor Author

I have moved the position of --no-color before upload when no-color=true. could you approve to run CI again? thank you.

@webknjaz
Copy link
Member

webknjaz commented Apr 22, 2024

Sure. Though, I'm not sure anymore if disabling color altogether is good. I'd rather disable progress bars but not the colorizarion. Perhaps, the Twine upstream needs to be consulted..

@shenxianpeng
Copy link
Contributor Author

I have tested the following commands to upload to testpypi, and both work with Python 3.11. and Python 3.12.

twine --no-color upload dist/* --repository testpypi
twine upload dist/* --repository testpypi
root@eca5ed1e5006:/src# twine --no-color upload dist/* --repository testpypi
Uploading distributions to https://test.pypi.org/legacy/
WARNING  Error getting password from keyring
         Traceback (most recent call last):
           File "/usr/local/lib/python3.12/site-packages/twine/auth.py", line 81, in get_password_from_keyring
             return cast(str, keyring.get_password(system, username))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           File "/usr/local/lib/python3.12/site-packages/keyring/core.py", line 56, in get_password
             return get_keyring().get_password(service_name, username)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           File "/usr/local/lib/python3.12/site-packages/keyring/backends/fail.py", line 28, in get_password
             raise NoKeyringError(msg)
         keyring.errors.NoKeyringError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the
         keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.
Enter your API token:
Uploading clang_tools-0.11.1.post1.dev5-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.9/19.9 kB • 00:00 • 19.3 MB/s
Uploading clang_tools-0.11.1.post1.dev5.tar.gz
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.1/79.1 kB • 00:00 • 171.3 MB/s

View at:
https://test.pypi.org/project/clang-tools/0.11.1.post1.dev5/
root@eca5ed1e5006:/src# python3 -V
Python 3.12.3
root@eca5ed1e5006:/src#

I'll try again soon to find the cause.

@webknjaz
Copy link
Member

I still think that it's best to get Twine to implement something like --no-animation instead and keep the color on.

@shenxianpeng
Copy link
Contributor Author

Thanks for the hint. twine upload supports --disable-progress-bar, which I hadn't realized before. this should be what you need.

@shenxianpeng shenxianpeng changed the title Add input no-color to support disabling colored output Add input disable-progress-bar to disable the progress bar Apr 25, 2024
@shenxianpeng
Copy link
Contributor Author

pre-commit.ci works in my local environment. 🤔

~/r/s/gh-action-pypi-publish (feature/support-no-color)> pre-commit run --all-files
Add trailing commas.......................................................Passed
isort.....................................................................Passed
Tabs remover..............................................................Passed
Validate GitHub Actions...................................................Passed
Validate GitHub Workflows.................................................Passed
Check GitHub Workflows set timeout-minutes................................Passed
Validate ReadTheDocs Config...........................(no files to check)Skipped
fix end of files..........................................................Passed
trim trailing whitespace..................................................Passed
mixed line ending.........................................................Passed
python tests naming...................................(no files to check)Skipped
check for added large files...............................................Passed
check BOM - deprecated: use fix-byte-order-marker.........................Passed
check for case conflicts..................................................Passed
check that executables have shebangs......................................Passed
check for merge conflicts.................................................Passed
check json............................................(no files to check)Skipped
check for broken symlinks.............................(no files to check)Skipped
check yaml................................................................Passed
detect private key........................................................Passed
check python ast..........................................................Passed
debug statements (python).................................................Passed
codespell.................................................................Passed
yamllint..................................................................Passed
flake8 WPS-excluded.......................................................Passed
flake8 WPS-only...........................................................Passed
pylint....................................................................Passed
Verify that enforced flake8 version stays unchanged.......................Passed

@webknjaz
Copy link
Member

pre-commit.ci works in my local environment. 🤔

pre-commit.ci upgraded their runtime to Python 3.12 yesterday which is incompatible with some linting configuration present. I'll address that separately.

twine-upload.sh Outdated Show resolved Hide resolved
@shenxianpeng shenxianpeng changed the title Add input disable-progress-bar to disable the progress bar Disable the progress bar when exec twine upload Apr 25, 2024
@shenxianpeng
Copy link
Contributor Author

pre-commit.ci upgraded their runtime to Python 3.12 yesterday which is incompatible with some linting configuration present. I'll address that separately.

Maybe can use default_language_version to pin the runtime version to the previous version. for example:

default_language_version:
    python: python3.11

@webknjaz
Copy link
Member

That's what I used elsewhere. But it's not something that's in the scope of this PR so let's keep it atomic.

@shenxianpeng
Copy link
Contributor Author

Yes. I rebased my commits and it's ready to run CI and your review.

twine-upload.sh Outdated Show resolved Hide resolved
twine-upload.sh Outdated Show resolved Hide resolved
twine-upload.sh Outdated Show resolved Hide resolved
twine-upload.sh Outdated Show resolved Hide resolved
@webknjaz webknjaz merged commit 67a07eb into pypa:unstable/v1 May 16, 2024
2 checks passed
@shenxianpeng shenxianpeng deleted the feature/support-no-color branch May 16, 2024 23:31
jooola referenced this pull request in ansible-community/molecule-hetznercloud Jun 19, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[pypa/gh-action-pypi-publish](https://togithub.com/pypa/gh-action-pypi-publish)
| action | minor | `v1.8.14` -> `v1.9.0` |

---

### Release Notes

<details>
<summary>pypa/gh-action-pypi-publish
(pypa/gh-action-pypi-publish)</summary>

###
[`v1.9.0`](https://togithub.com/pypa/gh-action-pypi-publish/releases/tag/v1.9.0)

[Compare
Source](https://togithub.com/pypa/gh-action-pypi-publish/compare/v1.8.14...v1.9.0)

#### 💅 Cosmetic Output Improvements

-
[@&#8203;woodruffw](https://togithub.com/woodruffw)[💰](https://togithub.com/sponsors/woodruffw)
updated the tense on password nudge in
[#&#8203;234](https://togithub.com/pypa/gh-action-pypi-publish/issues/234)
-
[@&#8203;shenxianpeng](https://togithub.com/shenxianpeng)[💰](https://togithub.com/sponsors/shenxianpeng)
helped us disable the progress bar that was being produced by the `twine
upload` command via
[#&#8203;231](https://togithub.com/pypa/gh-action-pypi-publish/issues/231)
-
[@&#8203;woodruffw](https://togithub.com/woodruffw)[💰](https://togithub.com/sponsors/woodruffw)
also linked the PyPI status dashboard in the trusted publishing error
message via
[https://github.com/pypa/gh-action-pypi-publish/pull/243](https://togithub.com/pypa/gh-action-pypi-publish/pull/243)

#### 🛠️ Internal Dependencies

- pre-commit linters got auto-updated @&#8203;
[#&#8203;225](https://togithub.com/pypa/gh-action-pypi-publish/issues/225)
-   some notable dependency bumps include
    -   `cryptography == 42.0.7`
    -   `id == 1.4.0`
- `idna == 3.7` via
[#&#8203;228](https://togithub.com/pypa/gh-action-pypi-publish/issues/228)
- `requests == 2.32.0` via
[#&#8203;240](https://togithub.com/pypa/gh-action-pypi-publish/issues/240)
    -   `Twine == 5.1.0`

#### ⚙️ Secret Stuff

In
[#&#8203;241](https://togithub.com/pypa/gh-action-pypi-publish/issues/241),
[@&#8203;br3ndonland](https://togithub.com/br3ndonland)[💰](https://togithub.com/sponsors/br3ndonland)
added a Docker label linking the container image to this repository for
GHCR to display it nicely. This is preparatory work for a big
performance-focused refactoring he's working on in
[#&#8203;230](https://togithub.com/pypa/gh-action-pypi-publish/issues/230).

#### 💪 New Contributors

- [@&#8203;shenxianpeng](https://togithub.com/shenxianpeng) made their
first contribution in
[https://github.com/pypa/gh-action-pypi-publish/pull/231](https://togithub.com/pypa/gh-action-pypi-publish/pull/231)
- [@&#8203;br3ndonland](https://togithub.com/br3ndonland) made their
first contribution in
[https://github.com/pypa/gh-action-pypi-publish/pull/241](https://togithub.com/pypa/gh-action-pypi-publish/pull/241)

**🪞 Full Diff**:
pypa/gh-action-pypi-publish@v1.8.14...v1.9.0

**🧔‍♂️ Release Manager:** [@&#8203;webknjaz
🇺🇦](https://togithub.com/sponsors/webknjaz)

**🙏 Special Thanks** to
[@&#8203;pradyunsg](https://togithub.com/pradyunsg)[💰](https://togithub.com/sponsors/pradyunsg)
for promptly unblocking this release to Marketplace as GitHub started
asking for yet another developer agreement signature from the
organization admins.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ansible-community/molecule-hetznercloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jooola referenced this pull request in hetznercloud/hcloud-python Jun 21, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[pypa/gh-action-pypi-publish](https://togithub.com/pypa/gh-action-pypi-publish)
| action | minor | `v1.8.14` -> `v1.9.0` |

---

### Release Notes

<details>
<summary>pypa/gh-action-pypi-publish
(pypa/gh-action-pypi-publish)</summary>

###
[`v1.9.0`](https://togithub.com/pypa/gh-action-pypi-publish/releases/tag/v1.9.0)

[Compare
Source](https://togithub.com/pypa/gh-action-pypi-publish/compare/v1.8.14...v1.9.0)

#### 💅 Cosmetic Output Improvements

-
[@&#8203;woodruffw](https://togithub.com/woodruffw)[💰](https://togithub.com/sponsors/woodruffw)
updated the tense on password nudge in
[#&#8203;234](https://togithub.com/pypa/gh-action-pypi-publish/issues/234)
-
[@&#8203;shenxianpeng](https://togithub.com/shenxianpeng)[💰](https://togithub.com/sponsors/shenxianpeng)
helped us disable the progress bar that was being produced by the `twine
upload` command via
[#&#8203;231](https://togithub.com/pypa/gh-action-pypi-publish/issues/231)
-
[@&#8203;woodruffw](https://togithub.com/woodruffw)[💰](https://togithub.com/sponsors/woodruffw)
also linked the PyPI status dashboard in the trusted publishing error
message via
[https://github.com/pypa/gh-action-pypi-publish/pull/243](https://togithub.com/pypa/gh-action-pypi-publish/pull/243)

#### 🛠️ Internal Dependencies

- pre-commit linters got auto-updated @&#8203;
[#&#8203;225](https://togithub.com/pypa/gh-action-pypi-publish/issues/225)
-   some notable dependency bumps include
    -   `cryptography == 42.0.7`
    -   `id == 1.4.0`
- `idna == 3.7` via
[#&#8203;228](https://togithub.com/pypa/gh-action-pypi-publish/issues/228)
- `requests == 2.32.0` via
[#&#8203;240](https://togithub.com/pypa/gh-action-pypi-publish/issues/240)
    -   `Twine == 5.1.0`

#### ⚙️ Secret Stuff

In
[#&#8203;241](https://togithub.com/pypa/gh-action-pypi-publish/issues/241),
[@&#8203;br3ndonland](https://togithub.com/br3ndonland)[💰](https://togithub.com/sponsors/br3ndonland)
added a Docker label linking the container image to this repository for
GHCR to display it nicely. This is preparatory work for a big
performance-focused refactoring he's working on in
[#&#8203;230](https://togithub.com/pypa/gh-action-pypi-publish/issues/230).

#### 💪 New Contributors

- [@&#8203;shenxianpeng](https://togithub.com/shenxianpeng) made their
first contribution in
[https://github.com/pypa/gh-action-pypi-publish/pull/231](https://togithub.com/pypa/gh-action-pypi-publish/pull/231)
- [@&#8203;br3ndonland](https://togithub.com/br3ndonland) made their
first contribution in
[https://github.com/pypa/gh-action-pypi-publish/pull/241](https://togithub.com/pypa/gh-action-pypi-publish/pull/241)

**🪞 Full Diff**:
pypa/gh-action-pypi-publish@v1.8.14...v1.9.0

**🧔‍♂️ Release Manager:** [@&#8203;webknjaz
🇺🇦](https://togithub.com/sponsors/webknjaz)

**🙏 Special Thanks** to
[@&#8203;pradyunsg](https://togithub.com/pradyunsg)[💰](https://togithub.com/sponsors/pradyunsg)
for promptly unblocking this release to Marketplace as GitHub started
asking for yet another developer agreement signature from the
organization admins.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/hetznercloud/hcloud-python).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
cuixq referenced this pull request in google/osv.dev Jul 3, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/checkout](https://togithub.com/actions/checkout) | action |
patch | `v4.1.6` -> `v4.1.7` |
| [github/codeql-action](https://togithub.com/github/codeql-action) |
action | patch | `v2.25.8` -> `v2.25.11` |
|
[pypa/gh-action-pypi-publish](https://togithub.com/pypa/gh-action-pypi-publish)
| action | minor | `v1.8.14` -> `v1.9.0` |

---

### Release Notes

<details>
<summary>actions/checkout (actions/checkout)</summary>

###
[`v4.1.7`](https://togithub.com/actions/checkout/blob/HEAD/CHANGELOG.md#v417)

[Compare
Source](https://togithub.com/actions/checkout/compare/v4.1.6...v4.1.7)

- Bump the minor-npm-dependencies group across 1 directory with 4
updates by [@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/actions/checkout/pull/1739](https://togithub.com/actions/checkout/pull/1739)
- Bump actions/checkout from 3 to 4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/actions/checkout/pull/1697](https://togithub.com/actions/checkout/pull/1697)
- Check out other refs/\* by commit by
[@&#8203;orhantoy](https://togithub.com/orhantoy) in
[https://github.com/actions/checkout/pull/1774](https://togithub.com/actions/checkout/pull/1774)
- Pin actions/checkout's own workflows to a known, good, stable version.
by [@&#8203;jww3](https://togithub.com/jww3) in
[https://github.com/actions/checkout/pull/1776](https://togithub.com/actions/checkout/pull/1776)

</details>

<details>
<summary>github/codeql-action (github/codeql-action)</summary>

###
[`v2.25.11`](https://togithub.com/github/codeql-action/compare/v2.25.10...v2.25.11)

[Compare
Source](https://togithub.com/github/codeql-action/compare/v2.25.10...v2.25.11)

###
[`v2.25.10`](https://togithub.com/github/codeql-action/compare/v2.25.9...v2.25.10)

[Compare
Source](https://togithub.com/github/codeql-action/compare/v2.25.9...v2.25.10)

###
[`v2.25.9`](https://togithub.com/github/codeql-action/compare/v2.25.8...v2.25.9)

[Compare
Source](https://togithub.com/github/codeql-action/compare/v2.25.8...v2.25.9)

</details>

<details>
<summary>pypa/gh-action-pypi-publish
(pypa/gh-action-pypi-publish)</summary>

###
[`v1.9.0`](https://togithub.com/pypa/gh-action-pypi-publish/releases/tag/v1.9.0)

[Compare
Source](https://togithub.com/pypa/gh-action-pypi-publish/compare/v1.8.14...v1.9.0)

#### 💅 Cosmetic Output Improvements

-
[@&#8203;woodruffw](https://togithub.com/woodruffw)[💰](https://togithub.com/sponsors/woodruffw)
updated the tense on password nudge in
[#&#8203;234](https://togithub.com/pypa/gh-action-pypi-publish/issues/234)
-
[@&#8203;shenxianpeng](https://togithub.com/shenxianpeng)[💰](https://togithub.com/sponsors/shenxianpeng)
helped us disable the progress bar that was being produced by the `twine
upload` command via
[#&#8203;231](https://togithub.com/pypa/gh-action-pypi-publish/issues/231)
-
[@&#8203;woodruffw](https://togithub.com/woodruffw)[💰](https://togithub.com/sponsors/woodruffw)
also linked the PyPI status dashboard in the trusted publishing error
message via
[https://github.com/pypa/gh-action-pypi-publish/pull/243](https://togithub.com/pypa/gh-action-pypi-publish/pull/243)

#### 🛠️ Internal Dependencies

- pre-commit linters got auto-updated @&#8203;
[#&#8203;225](https://togithub.com/pypa/gh-action-pypi-publish/issues/225)
-   some notable dependency bumps include
    -   `cryptography == 42.0.7`
    -   `id == 1.4.0`
- `idna == 3.7` via
[#&#8203;228](https://togithub.com/pypa/gh-action-pypi-publish/issues/228)
- `requests == 2.32.0` via
[#&#8203;240](https://togithub.com/pypa/gh-action-pypi-publish/issues/240)
    -   `Twine == 5.1.0`

#### ⚙️ Secret Stuff

In
[#&#8203;241](https://togithub.com/pypa/gh-action-pypi-publish/issues/241),
[@&#8203;br3ndonland](https://togithub.com/br3ndonland)[💰](https://togithub.com/sponsors/br3ndonland)
added a Docker label linking the container image to this repository for
GHCR to display it nicely. This is preparatory work for a big
performance-focused refactoring he's working on in
[#&#8203;230](https://togithub.com/pypa/gh-action-pypi-publish/issues/230).

#### 💪 New Contributors

- [@&#8203;shenxianpeng](https://togithub.com/shenxianpeng) made their
first contribution in
[https://github.com/pypa/gh-action-pypi-publish/pull/231](https://togithub.com/pypa/gh-action-pypi-publish/pull/231)
- [@&#8203;br3ndonland](https://togithub.com/br3ndonland) made their
first contribution in
[https://github.com/pypa/gh-action-pypi-publish/pull/241](https://togithub.com/pypa/gh-action-pypi-publish/pull/241)

**🪞 Full Diff**:
pypa/gh-action-pypi-publish@v1.8.14...v1.9.0

**🧔‍♂️ Release Manager:** [@&#8203;webknjaz
🇺🇦](https://togithub.com/sponsors/webknjaz)

**🙏 Special Thanks** to
[@&#8203;pradyunsg](https://togithub.com/pradyunsg)[💰](https://togithub.com/sponsors/pradyunsg)
for promptly unblocking this release to Marketplace as GitHub started
asking for yet another developer agreement signature from the
organization admins.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 6am on wednesday" in timezone
Australia/Sydney, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/google/osv.dev).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: Xueqin Cui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

option to disable twine progressbar
2 participants