Skip to content

♻️ [MRG] Packaging and console script#15

Merged
jponttuset merged 8 commits into
google-research:masterfrom
hayesall:package
Dec 14, 2019
Merged

♻️ [MRG] Packaging and console script#15
jponttuset merged 8 commits into
google-research:masterfrom
hayesall:package

Conversation

@hayesall
Copy link
Copy Markdown
Contributor

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

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
Copy Markdown
Collaborator

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!

Comment thread arxiv_latex_cleaner/arxiv_latex_cleaner.py Outdated
Comment thread arxiv_latex_cleaner/arxiv_latex_cleaner.py Outdated
Comment thread arxiv_latex_cleaner/arxiv_latex_cleaner.py Outdated
@jponttuset jponttuset added the enhancement New feature or request label Dec 13, 2019
Fix two re.sub commands and a docstring
@hayesall
Copy link
Copy Markdown
Contributor Author

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.

Comment thread arxiv_latex_cleaner/__main__.py Outdated
Fix missing space after "user-defined"
@jponttuset jponttuset merged commit 3b58117 into google-research:master Dec 14, 2019
@jponttuset
Copy link
Copy Markdown
Collaborator

Thanks again @hayesall!

@hayesall hayesall deleted the package branch December 14, 2019 17:24
goemon07 added a commit to spritz-group/arxiv-latex-cleaner that referenced this pull request Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants