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

py2/3 and precommit #1375

Closed
phyy-nx opened this issue Aug 12, 2020 · 1 comment
Closed

py2/3 and precommit #1375

phyy-nx opened this issue Aug 12, 2020 · 1 comment
Assignees

Comments

@phyy-nx
Copy link
Member

phyy-nx commented Aug 12, 2020

precommit seems to be broken in my conda environment. Here's an example of an error message I get (this is a build using conda at PAL, <working> subbed for bootstrap folder):

$ libtbx.precommit install
Conda: <working>/conda_base/bin/conda
Conda python: <working>/conda_base/bin/python3.6
Conda version: 4.8.3
Base Python: 3.6.11
Installing precommit...
Traceback (most recent call last):
  File "<working>/modules/dials/precommitbx/installer.py", line 697, in main
    import pre_commit.constants
ModuleNotFoundError: No module named 'pre_commit'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<working>/build/../modules/dials/command_line/precommitbx.py", line 7, in <module>
    dials.precommitbx.installer.main()
  File "<working>/modules/dials/precommitbx/installer.py", line 701, in main
    install_precommit_into_conda(conda)
  File "<working>/modules/dials/precommitbx/installer.py", line 220, in install_precommit_into_conda
    stop_on_error="Error installing pre-commit to conda base",
  File "<working>/modules/dials/precommitbx/installer.py", line 73, in clean_run
    print("\n".join(result.stdout.split("\n")[-10:]))
TypeError: a bytes-like object is required, not 'str'

Py3 bug? Looks like there are two errors?

Comment from @Anthchirp:

Looks like the precommit helper scripts still support python 2, which seems to be at least partially responsible for this.

@Anthchirp
Copy link
Member

The main issue was a string handling one. A lot of the complexity in this script however could now be done away with the conda environment. Only need to find the time 🙃

Anthchirp added a commit that referenced this issue Aug 28, 2020
Anthchirp added a commit that referenced this issue Aug 28, 2020
@ndevenish ndevenish mentioned this issue Sep 1, 2020
Anthchirp added a commit that referenced this issue Sep 1, 2020
@Anthchirp Anthchirp mentioned this issue Sep 1, 2020
ndevenish added a commit that referenced this issue Sep 1, 2020
- ``dials.scale``: Prevent discarding of resolution limits in rare cases, which could cause incorrect symmetry determination, and worse results. (#1378)
- ``dials.cosym``: filter out experiments with inconsistent unit cells (#1380)
- Internally slicing experiments now works if image range doesn't start at 1 (#1383)
- Restore missing I/sigma(I) resolution estimate log output (#1384)
- ``dials.image_viewer``: "Save As" button now works, for single panels
- Fix developer ``libtbx.precommit`` installation error (#1375
Anthchirp added a commit that referenced this issue Sep 2, 2020
* read correct angles in Nexus files where angles are saved in radians (cctbx/dxtbx#192)
* fix file processing issues where % characters are in the path (cctbx/dxtbx#214)
* allow reading SMV ADSC format files with non-integer pedestal (cctbx/dxtbx#216)
* libtbx.precommit: fix setup crash on Python 3 (#1375)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants