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

pdm init fails (also pdm info) #1993

Closed
sr-murthy opened this issue Jun 10, 2023 · 1 comment
Closed

pdm init fails (also pdm info) #1993

sr-murthy opened this issue Jun 10, 2023 · 1 comment
Labels
🐛 bug Something isn't working

Comments

@sr-murthy
Copy link
Contributor

  • [Y ] I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

My project is pyplist (Py 3.7.4 virtual env., Mac OS Ventura 13.0.1, Intel i5), it has setup.py defined, and it works fine on its own. So I tried to use pdm import to generate a pyproject.toml, and I get the error below:

$ pip install pdm
$ pdm import setup.py
$ pdm import setup.py
Traceback (most recent call last):
  File "/Users/srm/Documents/dev/pyplist-env/bin/pdm", line 5, in <module>
    from pdm.core import main
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/core.py", line 29, in <module>
    from pdm.project import Project
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/project/__init__.py", line 1, in <module>
    from pdm.project.config import Config, ConfigItem
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/project/config.py", line 86, in <module>
    class Config(MutableMapping[str, str]):
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/project/config.py", line 123, in Config
    platformdirs.user_config_path("pdm") / "global-project",
AttributeError: module 'platformdirs' has no attribute 'user_config_path'

Actual behavior

Error above

Expected behavior

A pyproject.toml file generated from setup.py.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
$ pdm info --env
Traceback (most recent call last):
  File "/Users/srm/Documents/dev/pyplist-env/bin/pdm", line 5, in <module>
    from pdm.core import main
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/core.py", line 29, in <module>
    from pdm.project import Project
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/project/__init__.py", line 1, in <module>
    from pdm.project.config import Config, ConfigItem
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/project/config.py", line 86, in <module>
    class Config(MutableMapping[str, str]):
  File "/Users/srm/Documents/dev/pyplist-env/lib/python3.7/site-packages/pdm/project/config.py", line 123, in Config
    platformdirs.user_config_path("pdm") / "global-project",
AttributeError: module 'platformdirs' has no attribute 'user_config_path'
@sr-murthy sr-murthy added the 🐛 bug Something isn't working label Jun 10, 2023
@sr-murthy
Copy link
Contributor Author

Follow up: I've been able to fix this, by fixing the pyproject.toml. Duplicate of #1995.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant