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

♻️ [MRG] Packaging and console script #15

Merged
merged 8 commits into from Dec 14, 2019
Merged

♻️ [MRG] Packaging and console script #15

merged 8 commits into from Dec 14, 2019

Conversation

hayesall
Copy link
Contributor

@hayesall hayesall commented Dec 13, 2019

Summary

This refactors the arxiv_latex_cleaner into a package, and adds a setup.py so this may be installed with a console point entry point.

Details

  • Move arxiv_latex_cleaner.py into package directory
  • Move arxiv_latex_cleaner_test.py into package directory
  • Add version information in arxiv_latex_cleaner/_version.py
  • Drop __main__ block from arxiv_latex_cleaner
  • Start using run_arxiv_cleaner as a public method
  • Fix test to reflect public run_arxiv_cleaner
  • Add argument parsing to arxiv_latex_cleaner.__main__
  • Add setup.py with an entry point to the main module

One of the biggest changes is the addition of the setup.py with an entry point that allows this to be used as a command-line program.

python setup.py install
arxiv_latex_cleaner --help

hayesall added 6 commits Dec 13, 2019
Add empty `arxiv_latex_cleaner/__main__.py`
Add empty `arxiv_latex_cleaner/_version.py`
Move `arxiv_latex_cleaner.py` into package directory
Move `arxiv_latex_cleaner_test.py` into package directory
Add empty `__init__.py`
Add version information in `arxiv_latex_cleaner/_version.py`
Fix `import` --> `from ... import`

Reworking this as a package changed the way import statements
work during testing. This fixes the import structure to make
tests pass again.
Drop `__main__` block from `arxiv_latex_cleaner`
Start using `run_arxiv_cleaner` as a public method
Fix test to reflect public `run_arxiv_cleaner`
Add argument parsing to `arxiv_latex_cleaner.__main__`
Add `exit(0)` to `__main__`
Add `setup.py` with an entry point to the main module
Add console script explanation, and optional installation info
@jponttuset
Copy link
Collaborator

@jponttuset jponttuset commented Dec 13, 2019

Hi @hayesall
Thank you so much for this PR, it much improves usability, very appreciated!
Could you just patch my two last CLs though, this PR reverts some of the changes.
I'll leave a comment where these changes happened.

Thanks again!

@jponttuset jponttuset added the enhancement label Dec 13, 2019
Fix two re.sub commands and a docstring
@hayesall
Copy link
Contributor Author

@hayesall hayesall commented Dec 13, 2019

Hey @jponttuset, thank you for catching the re.sub and docstring.

I was three commits behind when I started writing, I probably didn't merge them properly after fetching.

arxiv_latex_cleaner/__main__.py Outdated Show resolved Hide resolved
Fix missing space after "user-defined"
@jponttuset jponttuset merged commit 3b58117 into google-research:master Dec 14, 2019
1 check passed
@jponttuset
Copy link
Collaborator

@jponttuset jponttuset commented Dec 14, 2019

Thanks again @hayesall!

@hayesall hayesall deleted the package branch Dec 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants