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

Please rename src/whoosh_reloaded to src/whoosh for compatibility #36

Closed
cclauss opened this issue Feb 1, 2024 · 7 comments
Closed

Comments

@cclauss
Copy link
Collaborator

cclauss commented Feb 1, 2024

  test_whoosh_backend.py", line 9, in <module>
      from whoosh.analysis import SpaceSeparatedTokenizer, SubstitutionFilter
  ModuleNotFoundError: No module named 'whoosh'
@ZeroCool940711
Copy link
Contributor

The renaming was needed in order for us to be able to upload the package to PyPi since we dont have access to the old PyPi Whoosh project. It was also needed for visibility and to make it clear that the repo is not just a simple fork that didnt add anything but a continuation of Whoosh and that people should start using it from now on instead of the old repositories.

In your example code you can install whoosh-reloaded with either pip install whoosh-reloaded or from the repo with pip install git+https://github.com/Sygil-Dev/whoosh-reloaded.git and then rename the import to from whoosh_reloaded.analysis import SpaceSeparatedTokenizer, SubstitutionFilter and it would work. I recommend a simple search and replace for all the imports, just replace whoosh with whoosh_reloaded.

@cclauss
Copy link
Collaborator Author

cclauss commented Feb 1, 2024

The Python Imaging Library (PIL) was abandoned around the time of Python 3 and everyone today uses the friendly-fork named Pillow and this is how the src directory looks...

I can come up with other instances of taking over unmaintained forks if you need further proof...

I know the project name had to be changed for PyPI but renaming the file paths breaks all backward compatibility.

@ZeroCool940711
Copy link
Contributor

Ok, I understand, sorry for the troubles. You are correct. It might be possible to keep the folder as src/whoosh. I will look into that tomorrow when I wake up since I'm probably about to go to sleep for today. The main issue I had was first because of my lack of knowledge on what we could and couldn't do to avoid issues with conflicts and to make it so we could install any old version of whoosh as well as our fork without having conflicts between them. I also have not a lot of experience working with projects as complex as whoosh and publishing them to PyPi, so, I'm learning as I go :)

@ZeroCool940711
Copy link
Contributor

@cclauss just to confirm and be sure before I push the changes I have done.
We want to rename the src/whoosh_reloaded folder back to src/whoosh so we can continue to use the imports like from whoosh.analysis import SpaceSeparatedTokenizer, SubstitutionFilter instead of changing them to something new like from whoosh_reloaded.analysis import SpaceSeparatedTokenizer, SubstitutionFilter so you only need to change the location from where you are installing whoosh to our repo or use pip install whoosh-reloaded instead of pip install whoosh and everything should still be compatible with the old code, right?

If it is that way, then I can push the changes in a few minutes.

@cclauss
Copy link
Collaborator Author

cclauss commented Feb 2, 2024

That is correct.

@ZeroCool940711
Copy link
Contributor

ZeroCool940711 commented Feb 2, 2024

Ok, I have most of the stuff needed ready to be pushed to the main repo but I did find a lot of issues that I have no idea how they were ignored by the tests and we were not getting any errors about them, stuff like missing files that were removed without any explanation and are not even present on mchaput's or the whoosh-communty repo but were still been used in several places, so, I'm trying to fix those before pushing to the main repo since I have to fix the tests anyway.

@ZeroCool940711
Copy link
Contributor

Done. PR #37 should have addressed this. Let me know if there are any issues.

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