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

Creating a 🐍📦 with an entry point #45

Open
dpshelio opened this issue Nov 23, 2022 · 0 comments
Open

Creating a 🐍📦 with an entry point #45

dpshelio opened this issue Nov 23, 2022 · 0 comments
Labels
week07 Creating packages

Comments

@dpshelio
Copy link
Contributor

dpshelio commented Nov 23, 2022

Help Charlene run a command in her latest package (#44) from anywhere. You can do so by adding an entry point following the instructions below.

  1. Choose who in your team is writing now! (make sure you've pulled from your colleague's fork!)

  2. Move the if __name__ == "__main__": block to its own file (e.g., command.py) and add it as entry point to setup.py called "sagittal_average_run" (or to setup.cfg).

  3. Add the dependencies of this library as requirements to setup.py or setup.cfg.

  4. Try to install it by running pip install -e . where the setup.py (or setup.cfg)is.

  5. Go to a different directory, run python -c "import sagittal_average" and see whether the installation worked.

  6. Check you can use the entry point from anywhere, by calling sagittal_average_run <path/to/input/csv> from the different directory.

  7. Share your solution as a pull request to Charlene's repository mentioning this issue (by including the text Addresses UCL-COMP0233-22-23/RSE-Classwork#45 in the pull request description), remember to mention your team members too! (with @github_username)


Sample solution:
UCL-COMP0233-2022-2023/sagittal_average#4

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

No branches or pull requests

1 participant