Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

[wip] update pip mirror update policy, build deb package on each PR to verify policy is adhered to #36

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
version: 2
jobs:
build:
docker:
- image: circleci/python:3.5-stretch
steps:
- checkout

- run:
name: Install Debian packaging dependencies and download wheels
command: |
mkdir ~/packaging && cd ~/packaging
git clone https://github.com/freedomofpress/securedrop-debian-packaging.git
cd securedrop-debian-packaging
make install-deps && make fetch-wheels
- run:
name: Tag and make source tarball
command: |
cd ~/project
git tag 1000.0 # Dummy version number, doesn't matter what we put here
python3 setup.py sdist
Copy link
Contributor

Choose a reason for hiding this comment

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

This will build a tarball the version mentioned in the setup.py, not with the git tag.


- run:
name: Build debian package
command: |
cd ~/packaging/securedrop-debian-packaging
export PKG_VERSION=1000.0
export PKG_PATH=~/packaging/securedrop-proxy/dist/securedrop-proxy-$PKG_VERSION.tar.gz
Copy link
Contributor

Choose a reason for hiding this comment

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

This will be affected based on the comment above.

make securedrop-proxy

test:
docker:
- image: circleci/python:3.5
steps:
Expand All @@ -20,3 +48,10 @@ jobs:
set -e
source .venv/bin/activate
make safety

workflows:
version: 2
securedrop_proxy_ci:
jobs:
- test
- build
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,16 @@ pip install --require-hashes -r dev-requirements.txt

#### Update dependencies

To add or update a dependency, modify either `dev-requirements.in` and `requirements.in` and then run `make update-pip-dependencies`. This will generate `dev-requirements.txt` and `requirements.txt`.
If you're adding or updating a dependency, you need to:

**IMPORTANT:** Do not modify `build-requirements.txt` during normal development. We use a pip mirror for our build process and the hashes in that file point to wheels on our mirror.
1. Modify either `dev-requirements.in` and `requirements.in` (depending on whether it is prod or dev only) and then run `make update-pip-dependencies`. This will generate `dev-requirements.txt` and `requirements.txt`.

2. For building a debian package from this project, we use the requirements in
`build-requirements.txt` which uses our pip mirror, i.e. the hashes in that file point to
wheels on our pip mirror. A maintainer will need to add
the updated dependency to our pip mirror (you can request this in the PR).

3. Once the pip mirror is updated, you should checkout the [securedrop-debian-packaging repo](https://github.com/freedomofpress/securedrop-debian-packaging) and run `make requirements`. Commit the `build-requirements.txt` that results and add it to your PR.

#### configuration

Expand Down