# 002 Internal
# todo
- jitsi
# Plan
- :03 Welcome and credits
- Brief intro of us
- what the series is about
- Credits:
- OBS
- hackmd: If you have spare cycles, please help keep hackmd organized and copy questions from chat to there.
- feedback
- suggestions for topics
- Topics of session this time (Github PRs and dependency management)
- We try to have some basic stuff, and get more advanced towards the end
- We show examples, but the full story is usually deeper. We can go deeper in the later discussion.
- :05 From last time: Zenodo publications in google scholar?
- a zenodo question, has anyone managed for their zenodo publication to show up in google scholar?
- No, seems like various technical reasons, such as mixed content and URL structure
- https://github.com/openjournals/brief-ideas/issues/132#issuecomment-335700342
- :20 How do you make a Github pull request using the web interface?
- RB: Explain what PRs are, they are called MRs on Github = **change proposal**
- RD: Please ask questions in hackmd
- RD: last time we asked participants to share a code or pull request and got a suggestion
- RD: Introduce our guest
- RB asks C:
- "Before we go into the example: What do you usually use Github for?" (CB: collaboration on papers)
- "How do you review each others changes/make sure you agree on the content?" ...
- what is this project about?
- why are you collaborating on this using GitHub and pull requests?
- RB starts sharing screen and we browse https://github.com/mlswg/mls-protocol
- RB scrolls a bit and comments on README, CI, contributing guide
- RB can ask C: where are the HTML pages served which are automatically built? (the "make upload")
- RB looks at existing PRs
- RB opens up the Markdown file both in rendered and in raw
- Two ideas for changes (you can decide):
- we add a table of contents (more than one line)
- or we add proper Python highlighting (one-liner)
- RB demonstrates how to submit the change through web interface
- I might ask you what would be a good title for the PR
- OK if I ask you about your GH username to ping you?
- What's a draft PR. vs making an issue to discuss first?
- RB will ask you whether you have questions and thank you Chris
- To audience: Come back next time to see how it turns out!
- Idea 1: If we have time, RB shows 1-2 real life PRs, either outs or from some open source project which is not too niche/difficult
- Idea 2: we discuss with Richard what are the things we look at when reviewing a pull request
- Questions? Please write in hackmd.
- RD: Keeping your code clean: using a code linter (pylint)
- [setup: rm ~/.cache/pre-commit/ ~/.git/hooks/pre-commit .venv; create .venv, pip install pylint]
- What's a code linter?
- `pip install pylint`
- `pylint messy.py`
- What if we want to lint always?
- `pip install pre-commit`
- `pre-commit install`
- `# pylint: disable=unused-argument`
- When is this a good idea?
- 5 Q&A
- encourage help in organizing hackpad
=== halfway ===
- 15 RD: Managing dependencies in code
- Learning outcome: in Python, use and create a requirements.txt file.
- If you take someone else's code, do you think you could run it? Why not?
- demo code: `rsh-demo`
- python3 dependencies.py
- requirements.txt
- make sample requirements.txt
- How to install these things? virtualenvs
- `virtualenv` vs `python3 -m venv`
- python3 -m venv venv3
- source ./venv3/bin/activate
- which python
- which pip
- pip install mock
- How do I figure out what my dependencies are?
- trial and error. try to keep started early
- Make your environment reproducible: delete and start over is never bad!
- networkx<2.0
- What if stuff changes? What if we want exactly reproducible?
- pip freeze
- What about a library? `setup.py`
-
- Other ways to record dependencies (other languages)
- requirements.txt for pip
- environment.yml for conda
- setup.py vs requirements.txt
- But there are other options: Pipenv, poetry
- virtualenvironments is Python
- .
- alias for "ve"
- Strict dependencies (deployments, environments) vs very flexible dependencies (libraries)
- How it work in other languages:
- R: `renv`
- C++ code: through CMake, conan.io, conda, ...
- Newer languages tend to have it more built-in.
- More advanced options: containers
- Entire OS in a package
- Mention ReproHacks
- 3 Two interesting .gitconfig tricks: excludesfile and insteadOf
- `git config --global core.excludesfile=~/.gitignore`
- `git config --global url.git@github.com:ResearchSoftwareHour/.insteadOf rsh:`
- 3 TILs
- encourage using TILs
- 3 Julia Evan's blog and zines
- Julia Evans blog and zines
- 10 Q&A
- 2 Clarify ways to contribute to RSH
- 1 Conclusion
- Epilogue discussion