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

Fix #466 projex generates pyproject.toml #488

Merged
merged 5 commits into from
Jun 28, 2024
Merged

Conversation

robnagler
Copy link
Member

- pksetup: removed tox, readthedocs support
Fix #429 added readthedocs.yml
Fix #386 projex generates proper sphinx and readthedocs.yml
Fix #393 added pkcli.sphinx.prepare for readthedocs
- Added sphinx test which also tests projex
- Fixed various RST errors in modules
Fix #449 use GitHub workflow actions/checkout@v4 (also projex)
Copy link
Contributor

@rorour rorour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g tox still shows some instances that I think can be removed.

@rorour
Copy link
Contributor

rorour commented Jun 24, 2024

I'm getting this error. Is projex broken?

@rorour
Copy link
Contributor

rorour commented Jun 24, 2024

Actually not exactly that error, but it seems related.

[py3;@v wxyz]$ pykern projex init_rs_tree "my wxyz project"
Traceback (most recent call last):
  File "/home/vagrant/.pyenv/versions/py3/bin/pykern", line 8, in <module>
    sys.exit(main())
  File "/home/vagrant/src/radiasoft/pykern/pykern/pykern_console.py", line 17, in main
    return pkcli.main("pykern")
  File "/home/vagrant/src/radiasoft/pykern/pykern/pkcli/__init__.py", line 166, in main
    res = argh.dispatch(parser, argv=argv)
  File "/home/vagrant/.pyenv/versions/3.9.15/envs/py3/lib/python3.9/site-packages/argh/dispatching.py", line 183, in dispatch
    for line in lines:
  File "/home/vagrant/.pyenv/versions/3.9.15/envs/py3/lib/python3.9/site-packages/argh/dispatching.py", line 294, in _execute_command
    for line in result:
  File "/home/vagrant/.pyenv/versions/3.9.15/envs/py3/lib/python3.9/site-packages/argh/dispatching.py", line 277, in _call
    result = function(*positional, **keywords)
  File "/home/vagrant/src/radiasoft/pykern/pykern/pkcli/projex.py", line 76, in init_rs_tree
    init_tree(
  File "/home/vagrant/src/radiasoft/pykern/pykern/pkcli/projex.py", line 108, in init_tree
    base = pkresource.filename("projex")
  File "/home/vagrant/src/radiasoft/pykern/pykern/pkresource.py", line 47, in filename
    for f, p in _files(relative_filename, caller_context, packages):
  File "/home/vagrant/src/radiasoft/pykern/pykern/pkresource.py", line 90, in _files
    pkg_resources.resource_filename(
  File "/home/vagrant/.pyenv/versions/3.9.15/envs/py3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1181, in resource_filename
    return get_provider(package_or_requirement).get_resource_filename(
  File "/home/vagrant/.pyenv/versions/3.9.15/envs/py3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 391, in get_provider
    return _find_adapter(_provider_factories, loader)(module)
  File "/home/vagrant/.pyenv/versions/3.9.15/envs/py3/lib/python3.9/site-packages/pkg_resources/__init__.py", line 1460, in __init__
    self.module_path = os.path.dirname(getattr(module, '__file__', ''))
  File "/home/vagrant/.pyenv/versions/3.9.15/lib/python3.9/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

@robnagler
Copy link
Member Author

@rorour I can't reproduce the projex failure above:

$ mkdir wxyz; cd wxyz; git init .; pykern projex init_rs_tree "my wxyz project"
Initialized empty Git repository in /home/vagrant/src/radiasoft/wxyz/.git/
$

@robnagler
Copy link
Member Author

g tox still shows some instances that I think can be removed.

11e648a

Copy link
Contributor

@rorour rorour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works in my vm_devbox but not my local vm. I tried radia_run sirepo-dev and uninstalled/reinstalled pykern. I don't have any idea what's causing the failure.

@robnagler robnagler merged commit 70b894d into master Jun 28, 2024
3 checks passed
@robnagler robnagler deleted the 446-projex-toml-sphinx branch June 28, 2024 18:22
@robnagler
Copy link
Member Author

It's probably an old python package on your local vm.

@rorour
Copy link
Contributor

rorour commented Jun 28, 2024

Do you know how I can find out which package and/or how to fix it?

@moellep
Copy link
Member

moellep commented Jun 28, 2024

You could run "pip list --outdated" to see old packages and update them using a command found here:
https://stackoverflow.com/questions/2720014/how-to-upgrade-all-python-packages-with-pip

Probably need to run "pip install -e ." in the sirepo and pykern directory afterward to downgrade anything.

Maybe @robnagler has a better way to do this.

@robnagler
Copy link
Member Author

Try this first:

cd ~/src/radiasoft/pykern
pip install --upgrade --upgrade-strategy only-if-needed .

If projex still fails, we have something that needs bumping in pyproject.toml. Then we would want to know which packages need updating and that's trickier to debug, because you have to upgrade packages one at a time.

@rorour
Copy link
Contributor

rorour commented Jun 28, 2024

cd ~/src/radiasoft/pykern
pip install --upgrade --upgrade-strategy only-if-needed .

This fixed it. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants