General notes on the following technologies:
- Git
- Docker
- SQL Server
- Node
- Python
- Azure
- VS Code
- Clean code
Git
Squashing commits
This seems to be the standard method.
To summarise - on the relevant branch use the following to open the default text editor (where x is the number of commits to include):
Leave one commit as ‘pick’ and change the rest to ‘squash’.
Interesting discussion of the squash rebase workflow.
There are alternative approaches:
Rebasing wtih DevOps and squash commits
Scenario: A pull request has been made based on a developemnt branch. Upon completion will be merged to master using a squash commit. In the meantime, additional development - that is dependent on the changes that make up the first PR - has started. When the the PR is completed the second development branch will have a different history (it’s based on the original commits that have now turned in to a single squash on master). To avoid dealing with conflicts the second development branch can be rebased on to of master.
- Once the PR is complete, checkout ‘master’ and pull to ensure it is up-to-date.
- Checkout the development branch and run the following (change the final number to reflect the number of commits in the development branch):
Cleaning up old branches
Docker
Useful containers
Copying files
Volumes
DO NOT use ~ (home directory) when specifying volumes (on Windows).
House keeping
Remove all images that aren’t connected to a container:
Error occured: Cannot enable hyper-v service
This occured after a BIOS update. Hyper-V was still enable but Docker could not launch. Running:
As discussed here resolved the issue.
Docker Compose
Find out information about running processes:
SQL Server
When logs get big you can try this (from here):
Node
Python
Installing on Windows
Installation method | Expected path |
---|---|
Manual (all users) | C:\Python3x |
Manual (local user) | C:\Users\[user]\AppData\Local\Programs\Python\Python3x |
Microsoft Visual Studio | C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64 |
See this SO answer for more information about the Microsoft Visual Studio location.
Anaconda
The key benefits of using Anaconda from this SO answer:
Anaconda is a python and R distribution. It aims to provide everything you need (Python-wise) for data science “out of the box”. It includes:
and
It is quite complete and avoids problems in building libraries that you need from source code, that frequently plague one by one installations of those libraries by tools like pip.
Considerations:
- The independent package management can sometimes be behind.
- Larger size - is it suitable for the project e.g. Docker perhaps?
Unit testing
-
- Make your
source
andtests
directories siblings. - Ensure
__init__.py
exists in both (for test discovery).
- Make your