radiasoft / rswarp

Python utilities specific to running Warp
Other
5 stars 5 forks source link

Fix #12: use pkcli; Fix #11: use pketup #13

Closed robnagler closed 5 years ago

robnagler commented 5 years ago

collapsed run_warp.py and run_warp_nersc.py into pkcli/tec.py rswarp tec test now allows override of any parameter on command line, plus prints help including default parameters. rswarp tec nersc documents args and parameters file setup.py uses pksetup, which installs scripts, sets version, etc. Syntax is Napoleon/Sphinx compatible

robnagler commented 5 years ago

Thanks for noticing scripts was still in there.

You need to upgrade requests. I just bumped the required version in pykern/setup.py to 2.18, which should make it easier, but I don't think it's going to be easy in your environment, because it's in /usr/local.

We use pyenv so that any package can upgrade any packages it requires. Maybe you (as an ordinary user) has write access to /usr/local. Not something I would recommend on a Mac; user-writable system directories allows opportunities for privilege escalation and local exploits. It's something viruses look for.

I would also recommend working inside a VM. It's going to give you more consistent results. You can use pyenv on a Mac, but there will be compiler and library differences.

cchall commented 5 years ago

Sorry, still haven't been able to properly test this. I tried installing pykern and rswarp in a clean pyenv and the requests error is gone however something new has taken its place.

$ rswarp
Traceback (most recent call last):
  File "/usr/local/bin/rswarp", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3088, in <module>
    @_call_aside
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3072, in _call_aside
    f(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3101, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 576, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 589, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 783, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pytest 3.0.1 (/usr/local/lib/python2.7/site-packages), Requirement.parse('pytest>=3.1.0'), set(['pytest-forked']))

However the version of pytest that pip knows about would seem to meet this requirement:

$ pip show pytest
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Name: pytest
Version: 3.2.3
Summary: pytest: simple powerful testing with Python
Home-page: http://pytest.org
Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others
Author-email: UNKNOWN
License: MIT license
Location: /Users/chall/.pyenv/versions/test_pykern/lib/python2.7/site-packages
Requires: py, setuptools
Required-by: pytest-forked, pykern
robnagler commented 5 years ago

When you run rswarp, it is using /usr/local/lib/python2.7. When you run pip, it seems to be using /Users/chall/.pyenv/versions/test_pykern.

You have to be very careful when managing multiple Python environments to remove one or the other from $PATH.

cchall commented 5 years ago

That fixed up my problems. Changes seem to be working great.