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

Simplify package structure: move arxiv module to root #73

Closed
wants to merge 3 commits into from

Conversation

lukasschwab
Copy link
Owner

Description

Rearranges package files and updates package scripts accordingly without changing package behavior.

  • Simplifies generating docs.
  • Consolidates to a single supported import pattern: import arxiv.
  • Resolves docs suggesting the overcomplicated from arxiv import arxiv pattern and docs/README inconsistency.

Concern: we may want to add submodules to this package, e.g. to assist in query string construction. We shouldn't merge this change until we're confident it doesn't preclude or complicate adding submodules.

Breaking changes

List any changes that break the API usage supported on master.

  • Breaks submodule imports: from arxiv import arxiv.
    This was an antipattern for a simple package; import arxiv provided exactly the same functionality.

Relevant issues

List GitHub issues relevant to this change.

Discussed on #68: #68 (comment)

Checklist

  • (If appropriate) README.md example usage has been updated.

@lukasschwab
Copy link
Owner Author

lukasschwab commented Jun 23, 2021

It may be possible to go back to a package pattern where arxiv is still available via import arxiv (i.e. without breaking the usage forced by this change). Start by reverting this change, then introducing submodules. One could write

from arxiv import arxiv, query_helpers

directly accessing the modules arxiv.arxiv and arxiv.query_helpers, or just

import arxiv

using arxiv/__init__.py's import, which makes the API available without specifying the submodule. I suppose the real problem this PR tries to solve is that the package structure is unwieldy for a package containing a single module––we get usable, but unnecessarily verbose, documentation.

@lukasschwab
Copy link
Owner Author

This PR may be closed in favor of #84, which introduces submodules––

  • Module query is exported by default, so import arxiv allows for the usage arxiv.Query(...).
  • Module category must be imported explicitly, i.e. with from arxiv import category.

@lukasschwab
Copy link
Owner Author

Closing: stale.

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

Successfully merging this pull request may close these issues.

None yet

1 participant