Skip to content

Repos have syntax errors #48

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

Open
srush opened this issue Sep 21, 2024 · 3 comments
Open

Repos have syntax errors #48

srush opened this issue Sep 21, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@srush
Copy link
Collaborator

srush commented Sep 21, 2024

Several of the repos that I have played with start with a syntax error. Think we should avoid syntax errors when possible.

ImportError while loading conftest '/testbed/tests/conftest.py'.
tests/conftest.py:5: in <module>
    from jinja2 import loaders
src/jinja2/__init__.py:6: in <module>
    from .bccache import BytecodeCache as BytecodeCache
E     File "/testbed/src/jinja2/bccache.py", line 26
E       bc_version = 5
E   IndentationError: expected an indented block after class definition on line 25
@srush
Copy link
Collaborator Author

srush commented Sep 21, 2024

ImportError while loading conftest '/testbed/tests/conftest.py'.
tests/conftest.py:3: in <module>
    import simpy
src/simpy/__init__.py:16: in <module>
    from simpy.core import Environment
src/simpy/core.py:49: in <module>
    class Environment:
src/simpy/core.py:99: in Environment
    process = BoundClass(Process)
E   TypeError: BoundClass() takes no arguments

@wenting-zhao wenting-zhao self-assigned this Sep 21, 2024
@wenting-zhao wenting-zhao added the bug Something isn't working label Sep 21, 2024
@wenting-zhao
Copy link
Collaborator

This one is hard to fully resolved. As we discussed, sometimes a function being imported in tests may be removed entirely. However, I did the following to remove a subset of the errors:

  1. don't touch special functions that start with __ and end with __, so functions like init would be untouched
  2. if all functions under a class are removed, add a pass statement to the class

The two specific errors you pointed out here are solved.

Changes are done in the build_dataset repo. I have updated the docker images on docker hub for the updated repos.

Later if we have further ideas on how to better handle errors, lmk.

@srush
Copy link
Collaborator Author

srush commented Sep 22, 2024

Failed imports are okay, think it's mostly errors of the first type (bad indents) that I think we can avoid.

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

2 participants