Comments (7)
Maybe pdm can also install the user script to the bin location and then set sys.argv[0] appropriately.
from pdm.
[tool.poetry.scripts]
is the way to expose a console script entry point for the installable package. The equivalent in PDM is the PEP standard [project.scripts]
. And you must run pdm install
, which installs the project itself, to make it work.
On the contrast, [tool.pdm.scripts]
is a table of tasks with a name for each.
from pdm.
@frostming pdm install
does not seem to work or install the project itself.
I added the following to pyproject.toml after removing the [tool.pdm.scripts]
[project.scripts]
llmft = "llmft.cli:run"
After doing pdm install
it doesn't say anything about installing the project. Just says all packages are synced nothing to do.
When I do pdm run llmft
it says
[PdmUsageError]: Command 'llmft' is not found in your PATH.
I try to manually run pdm run python llmft/cli.py
λ pdm run python llmft/cli.py
Traceback (most recent call last):
File "/home/void/Projects/Research/llmft/llmft/cli.py", line 3, in <module>
from llmft.fit import fit
ModuleNotFoundError: No module named 'llmft'
So the project itself is not being installed?
from pdm.
I think you need to give a name to your project:
[project]
name = "llmft-or-something-like-that"
Otherwise PDM doesn't consider your project as a package and does not try to install it.
from pdm.
I do have it, here is my pyproject.toml
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
name = "llmft"
version = "0.1.0"
description = "LLM Finetuner"
authors = [
{name = "Vikash Balasubramanian", email = "[email protected]"},
]
dependencies = [
"torch>=2.1.2",
"numpy>=1.26.3",
"transformers>=4.36.2",
"peft>=0.7.1",
"datasets>=2.16.1",
"arger>=1.4.8",
"pytorch-lightning>=2.1.3",
]
requires-python = "==3.11.*"
readme = "README.md"
license = {text = "MIT"}
[project.scripts]
llmft = "llmft.cli:run"
[tool.pdm]
package-type = "application"
[tool.pdm.dev-dependencies]
qa = [
"ruff>=0.1.11",
"mypy>=1.8.0",
]
tools = [
"python-lsp-server>=1.9.0",
"ruff-lsp>=0.0.49",
]
from pdm.
the package type has to be "library" to make it installable
from pdm.
@frostming Ok thanks for that. Maybe it would be helpful if the document made it a bit more clear the differences between application and library.
I thought my project was an application since it had a console script entry point as a CLI application.
from pdm.
Related Issues (20)
- Feature request/proposal to expose project.scripts in output of `pdm show` HOT 2
- Proxy (HTTP_PROXY) settings are ignored for custom Repositories
- pdm venv activate doesn't quote strings properly for Powershell
- Inconsistent behavior between `pdm remove` and `pdm update`
- Unable to download non-py files HOT 2
- PDM caching breaks YoWASP packages HOT 5
- Remove editable package via CLI HOT 1
- In PowerShell `iex (pdm venv activate)` fails HOT 1
- Support for `--contstraint` file HOT 1
- Maximum recursion depth exceeded
- self update seem did not work HOT 2
- Allow installing packages without changing pyproject.toml HOT 1
- `pdm export --self` is incompatible with hashes (no `--without-hashes`)
- Locked incompatible file versions by Python version HOT 2
- Read operation timed out on bad connections
- Allow the repository url to be the service name in keyring HOT 1
- Skip using .netrc file on errors rather than raising HOT 1
- Auto show detail when step holding
- In monorepo, sibling dependencies can result in unintended absolute paths. HOT 2
- Settings for plugins
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdm.