These are notes for developers working on osxphotos. They're mostly to help me remember how to do things in this repo but will be useful to anyone who wants to contribute to osxphotos.
- Clone the repo:
git clone git@github.com:RhetTbull/osxphotos.git - Create a virtual environment and activate it:
python3 -m venv venvthensource venv/bin/activate. I use pyenv with pyenv-virtualenv to manage my virtual environments - Install the requirements:
python3 -m pip install -r requirements.txt - Install the development requirements:
python3 -m pip install -r dev_requirements.txt - Install osxphotos:
python3 -m pip install -e .
- Run all tests:
pytest
See the test README.md for more information on running tests.
If you want to contribute to osxphotos, please open a pull request. Here's how to do it:
- Fork the repo on GitHub
- Clone your fork:
git clone git@github.com:YOUR_USERNAME/osxphotos.git - Create a virtual environment and install osxphotos as described above
- Create a branch for your changes:
git checkout -b my_branch - Make your changes
- Add tests for your changes
- Run the tests:
pytest - Format the code:
isort .thenblack . - Update the README.md and other files as needed
- Add your changes using
git add - Commit your changes:
git commit -m "My changes description" - Push your changes to your fork:
git push origin my_branch - Open a pull request on GitHub
Note: Do not do this unless you are releasing a new version of osxphotos. This should not be run for normal pull requests. In general, only the maintainer should run the build script.
- Run
./build.shto run the build script.
For release, follow the following steps:
- Create a new branch for the release:
git checkout -b release_v0.72.1 - Run
bump2version [major|minor|patch] --verboseto bump version - Run the
build.sh - Commit the changes and push to GitHub
- Merge the changes in the main branch
- Checkout the main branch:
git checkout main - Pull the changes to your local repository:
git pull twine upload dist/osxphotos*.whl dist/*.tar.gz- Create a new release on GitHub:
gh release create "v0.72.1" dist/* - Pull the changes to your local repository:
git pull
The GitHub release must occur after the twine upload command so the GitHub action that updates the homebrew formula can be triggered.
cogapp is used to update the README.md and other files. cog will be called from the build script as needed.
There are some pre-built libraries in the osxphotos/lib directory. These are used by osxphotos to handle permissions. If you need to rebuild these libraries, see the README_DEV.md file in the osxphotos/lib directory.