Skip to content

Conversation

@heriet
Copy link
Member

@heriet heriet commented Jan 30, 2025

Summary

  • Migrate pipenv to uv

Problems

(1) DeprecationWarning: pkg_resources is deprecated as an API

Currently, nifcloud-cli:v1.15.0 image has occurs DeprecationWarning.

docker run -it --rm --entrypoint=ash ghcr.io/nifcloud/nifcloud-cli:v1.15.0
~ $ nifcloud help | head -n 1
/home/nifcloud/.local/bin/nifcloud:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').require('nifcloud-cli==1.15.0')

To fix, we should migrate pyproject.toml or enable PIP_USE_PEP517=1.

see pypa/setuptools#3981 (comment)

(2) Modern package manager

pyproject.toml is popular configuration file. And uv is a modern package manager and supports pyproject.toml.

Notice

  • The version of sphinx has been downgraded from ==5.3.0 to ==5.1.1
    • Because it occurs conflict colorama version that dependency of awscli==1.29.1.
  • Currentry, uv is not support task runner.
    • pipenv supports [scripts] config on Pipfile
    • So we should run manual. (ex. uv run pytest tests/unit --capture=sys)

Test

  • All checks have passed
  • The following Result is OK

Result

$ docker build -t nifcloud-cli-uv -f Dockerfile .
$ docker run -it --rm --entrypoint=ash nifcloud-cli-uv
~ $ nifcloud help | head -n 2

NIFCLOUD()                                                          NIFCLOUD()
~ $ pip list | grep nifcloud-cli
nifcloud-cli    1.15.0      /home/nifcloud
~ $ pip show -v nifcloud-cli
Name: nifcloud-cli
Version: 1.15.0
Summary: NIFCLOUD Command-Line Tools
Home-page: https://github.com/nifcloud/nifcloud-cli
Author: Fujitsu
Author-email: 
License: Apache-2.0
Location: /usr/local/lib/python3.11/site-packages
Requires: awscli, nifcloud, pyyaml
Required-by: 
Metadata-Version: 2.2
Installer: uv
Classifiers:
  Development Status :: 5 - Production/Stable
  Intended Audience :: Developers
  Intended Audience :: System Administrators
  Natural Language :: English
  License :: OSI Approved :: Apache Software License
  Programming Language :: Python
  Programming Language :: Python :: 3.7
  Programming Language :: Python :: 3.8
  Programming Language :: Python :: 3.9
  Programming Language :: Python :: 3.10
  Programming Language :: Python :: 3.11
Entry-points:
Project-URLs:
  Homepage, https://github.com/nifcloud/nifcloud-cli
$ docker run --rm -e NIFCLOUD_ACCESS_KEY_ID -e NIFCLOUD_SECRET_ACCESS_KEY -e NIFCLOUD_DEFAULT_REGION=jp-east-1 nifcloud-cli-uv computing describe-regions | head
{
    "RegionInfo": [
        {
            "IsDefault": true,
            "MessageSet": [
                {}
            ],
            "RegionEndpoint": "jp-east-1.computing.api.nifcloud.com",
            "RegionName": "east-1"
        },

@aokumasan
Copy link
Member

Thanks!! It's so cool 🚀

@aokumasan aokumasan merged commit 9e9faad into main Mar 10, 2025
14 checks passed
@fuku2014 fuku2014 deleted the migrate-pipenv-to-uv branch March 17, 2025 06:51
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.

3 participants