pdm

pdm 설치를 위한 pdm_test 폴더 생성

%cd ~/
%rm -r -d pdm_test
%mkdir pdm_test
%cd pdm_test
/home/yblee
/home/yblee/pdm_test

pdm 초기화

!pdm init -n
pyproject.toml already exists, update it now.
You are using the PEP 582 mode, no virtualenv is created.
For more info, please visit https://peps.python.org/pep-0582/
Changes are written to pyproject.toml.
Inside an active virtualenv /home/yblee/workspace/tdc/.venv, reusing it.
Set env var PDM_IGNORE_ACTIVE_VENV to ignore it.
!pdm venv create -w virtualenv
 Creating virtualenv using virtualenv.....
Virtualenv /home/yblee/pdm_test/.venv is created successfully
!pdm use --venv in-project
Using Python interpreter: /home/yblee/pdm_test/.venv/bin/python (3.10)

    Usage: pdm init [-h] [-v] [-g] [-p PROJECT_PATH] [-k SKIP] [-n]
                    [--python PYTHON]
                    [--backend {pdm-backend,setuptools,flit-core,hatchling,pdm-pep517}]
                    [--lib]

    Initialize a pyproject.toml for PDM

    Options:
      -h, --help            Show this help message and exit.
      -v, --verbose         Use `-v` for detailed output and `-vv` for more
                            detailed
      -g, --global          Use the global project, supply the project root with
                            `-p` option
      -p PROJECT_PATH, --project PROJECT_PATH
                            Specify another path as the project root, which
                            changes the base of pyproject.toml and __pypackages__
      -k SKIP, --skip SKIP  Skip some tasks and/or hooks by their comma-separated
                            names. Can be supplied multiple times. Use ":all" to
                            skip all hooks. Use ":pre" and ":post" to skip all pre
                            or post hooks.
      -n, --non-interactive
                            Don't ask questions but use default values
      --python PYTHON       Specify the Python version/path to use
      --backend {pdm-backend,setuptools,flit-core,hatchling,pdm-pep517}
                            Specify the build backend
      --lib                 Create a library project
!pdm venv list
Virtualenvs created with this project:

*  in-project: /home/yblee/pdm_test/.venv

library 설치

!pdm add numpy
Adding group default to lockfile
Adding packages to default dependencies: numpy
 Fetching hashes for resolved packages...
🔒 Lock successful
Changes are written to pyproject.toml.
?25l Fetching hashes for resolved packages...
Synchronizing working set with lock file: 1 to add, 0 to update, 0 to remove

   Install numpy 1.25.0 successful
36m⠧ Installing numpy 1.25.0...
🎉 All complete!

?25h
!pdm list --graph
numpy 1.25.0 [ required: >=1.25.0 ]
!tree .
.
├── pdm.lock
└── pyproject.toml

0 directories, 2 files