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

setup: add all executable modules as entry_points/console_scripts #659

Merged
merged 10 commits into from
Sep 11, 2021

Conversation

jhkennedy
Copy link
Collaborator

@jhkennedy jhkennedy commented Sep 9, 2021

Description of proposed changes

This add all currently executable modules as console_scripts entry_points in setup.py, addressing Task 3 in #652 and (I think) finished off #497. This comment gives a detailed explination of how entrypoints work, and how it changes develoment workflows.

*I have not extensively tested these scripts beyond making sure arguments are passed through appropriately and all can be called with --help.

Note: I've not added tropo_pyaps.py as I believe it's a legacy script that's been superseded by tropo_pyaps3.py.

Other thoughts:

  • It might be worth rearranging the setup.py file (e.g., move the packages and entry_points arguments to the bottom)

Reminders

  • Pass Codacy code review (green)
  • Pass Circle CI test (green)
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • If modifying functionality, describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

@welcome
Copy link

welcome bot commented Sep 9, 2021

💖 Thanks for opening this pull request! Please check out our contributing guidelines. 💖
Keep in mind that all new features should be documented. It helps to write the comments next to the code or below your functions describing all arguments, and return types before writing the code. This will help you think about your code design and usually results in better code.

@jhkennedy jhkennedy changed the title Add all currently executable modules as console_scripts entry_point in setup.py Add all currently executable modules as console_scripts entry_points in setup.py Sep 9, 2021
@jhkennedy
Copy link
Collaborator Author

Oh, I also have not addressed any installation, etc. type documentation -- that could be addressed here, or in conjunction with documentation about conda-forge after this has been vetted more.

mintpy/save_gbis.py Show resolved Hide resolved
mintpy/multi_transect.py Show resolved Hide resolved
mintpy/add_attribute.py Show resolved Hide resolved
mintpy/tsview.py Outdated Show resolved Hide resolved
@yunjunz yunjunz self-requested a review September 10, 2021 00:56
mintpy/tsview.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
@yunjunz
Copy link
Member

yunjunz commented Sep 10, 2021

It might be worth rearranging the setup.py file (e.g., move the packages and entry_points arguments to the bottom)

Sounds good to me, please do it as you see fit.

@yunjunz
Copy link
Member

yunjunz commented Sep 10, 2021

Oh, I also have not addressed any installation, etc. type documentation -- that could be addressed here, or in conjunction with documentation about conda-forge after this has been vetted more.

Yep, there will be big (good) changes in the installation. I would prefer to do it in another PR when conda-forge is ready and this PR is tested more as you said.

@yunjunz yunjunz changed the title Add all currently executable modules as console_scripts entry_points in setup.py setup: add all executable modules as entry_points/console_scripts Sep 10, 2021
@jhkennedy
Copy link
Collaborator Author

It might be worth rearranging the setup.py file (e.g., move the packages and entry_points arguments to the bottom)

Sounds good to me, please do it as you see fit.

Done!

Copy link
Member

@yunjunz yunjunz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good to me. I will do more testings on the weekend before merging it. Thank you @jhkennedy!

@yunjunz
Copy link
Member

yunjunz commented Sep 11, 2021

I installed and tested mintpy as below on macOS. Everything looks good to me.

# download
cd ~/tools
git clone https://github.com/insarlab/MintPy.git
# install
conda create --name test
conda activate test
conda install --file tools/MintPy/docs/requirements.txt pysolid pyaps3 gdal">=3"
cd ~/tools/MintPy
python setup.py install
# test
python ~/tools/MintPy/tests/test_smallbaselineApp.py

@yunjunz yunjunz merged commit 65fe5eb into insarlab:main Sep 11, 2021
@welcome
Copy link

welcome bot commented Sep 11, 2021

🎉 🎉 🎉 Congrats on merging your first pull request! We here at behaviorbot are proud of you! 🎉 🎉 🎉

@jhkennedy
Copy link
Collaborator Author

@yunjunz Just a note -- python -m pip install should be preferred over python setup.py install as setup.py invokes the old and depreciated egg protocol.

@yunjunz
Copy link
Member

yunjunz commented Sep 13, 2021

Good to know, thanks.

@jhkennedy jhkennedy deleted the entrypints branch November 13, 2021 06:13
yunjunz added a commit that referenced this pull request Nov 21, 2021
+ simplify the installation since now `pyaps3` and `pysolid` are available via conda-forge, so they are no longer need to be manually cloned and installed anymore. This simplifies the environment setup files and installation notes.

+ since #659, there's no longer a need to manipulate PATH or PYTHONPATH for mintpy anymore, as a "pip install" will correctly place the mintpy package and all executable scripts to be available in the environment.

Co-authored-by: Zhang Yunjun <yunjunzgeo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants