Skip to content

Commit

Permalink
Use requirements folder & Makefile & wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Räni committed Jan 9, 2021
1 parent a820027 commit 5ce489b
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 21 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ jobs:
- name: install
run: |
python -m pip install --upgrade pip wheel
pip install --require-hashes -r requirements.txt -r requirements-dev.txt
pip install --require-hashes -r requirements/ci.txt
- name: lint
run: |
black . --check --exclude proto
flake8
mypy .
run: make lint
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

# Copy requirements
COPY requirements.txt ./
COPY requirements/prod.txt ./

# Install build dependencies
RUN apt-get update && \
Expand All @@ -24,7 +24,8 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/*

# Install dependencies
RUN pip install --require-hashes -r requirements.txt
RUN pip install --upgrade --no-cache-dir pip wheel && \
pip install --require-hashes -r prod.txt

####################
# Production image #
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.PHONY: lint
lint:
black . --check --exclude proto
flake8
mypy .
2 changes: 2 additions & 0 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r prod.txt
-r dev.txt
File renamed without changes.
14 changes: 7 additions & 7 deletions requirements-dev.txt → requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes --output-file=requirements-dev.txt requirements-dev.in
# pip-compile --generate-hashes --no-emit-index-url requirements/dev.in
#
appdirs==1.4.4 \
--hash=sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41 \
--hash=sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128
# via black
black==20.8b1 \
--hash=sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea
# via -r requirements-dev.in
# via -r requirements/dev.in
click==7.1.2 \
--hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a \
--hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc
Expand All @@ -20,11 +20,11 @@ click==7.1.2 \
flake8==3.8.4 \
--hash=sha256:749dbbd6bfd0cf1318af27bf97a14e28e5ff548ef8e5b1566ccfb25a11e7c839 \
--hash=sha256:aadae8761ec651813c24be05c6f7b4680857ef6afaae4651a4eccaef97ce6c3b
# via -r requirements-dev.in
# via -r requirements/dev.in
grpc-stubs==1.24.3 \
--hash=sha256:39e83431a93e86f0b66bdf50e5e0edd288a92a6eaf5776a079c6ca235e2df22a \
--hash=sha256:66a349a200b751b655bc5e29adec58e19838e4b175ecd3f86a6b1476b6f93ca1
# via -r requirements-dev.in
# via -r requirements/dev.in
grpcio-tools==1.34.0 \
--hash=sha256:01a5939c325cb32e82837923ce8b14df8590c885fc23e28cae9dbfbe28acb69f \
--hash=sha256:0805a0c87a6452137ddb2afa696d25ab56557325a6c5251e09df3ec6f0340d07 \
Expand Down Expand Up @@ -72,7 +72,7 @@ grpcio-tools==1.34.0 \
--hash=sha256:e7fafc9d3f59ade993225b80006f25e2df2e1643dde93bd3e6ee9b26f081eb8a \
--hash=sha256:edc3ab63b5f4db0e4b2dbfea1272de5a77dec06341407978df64367ec5090bf5 \
--hash=sha256:fcf2820e5b5a18fb533e7e85eac852b659c2bbe817750042d4772bfc8bd5f942
# via -r requirements-dev.in
# via -r requirements/dev.in
grpcio==1.34.0 \
--hash=sha256:205eda06d8aeffc87a1e29ff1f090546adf0b6e766378cc4c13686534397fdb4 \
--hash=sha256:20606ec7c265f81c5a0226f69842dc8dde66d921968ab9448e59d440cf98bebf \
Expand Down Expand Up @@ -149,7 +149,7 @@ mypy==0.790 \
--hash=sha256:e97e9c13d67fbe524be17e4d8025d51a7dca38f90de2e462243ab8ed8a9178d1 \
--hash=sha256:eea260feb1830a627fb526d22fbb426b750d9f5a47b624e8d5e7e004359b219c
# via
# -r requirements-dev.in
# -r requirements/dev.in
# grpc-stubs
pathspec==0.8.1 \
--hash=sha256:86379d6b86d75816baba717e64b1a3a3469deb93bb76d613c9ce79edc5cb68fd \
Expand All @@ -158,7 +158,7 @@ pathspec==0.8.1 \
pip-tools==5.5.0 \
--hash=sha256:10841c1e56c234d610d0466447685b9ea4ee4a2c274f858c0ef3c33d9bd0d985 \
--hash=sha256:cb0108391366b3ef336185097b3c2c0f3fa115b15098dafbda5e78aef70ea114
# via -r requirements-dev.in
# via -r requirements/dev.in
protobuf==3.14.0 \
--hash=sha256:0e247612fadda953047f53301a7b0407cb0c3cb4ae25a6fde661597a04039b3c \
--hash=sha256:0fc96785262042e4863b3f3b5c429d4636f10d90061e1840fce1baaf59b1a836 \
Expand Down
1 change: 1 addition & 0 deletions requirements/pip.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip-tools==5.5.0
18 changes: 18 additions & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes --no-emit-index-url requirements/pip.in
#
click==7.1.2 \
--hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a \
--hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc
# via pip-tools
pip-tools==5.5.0 \
--hash=sha256:10841c1e56c234d610d0466447685b9ea4ee4a2c274f858c0ef3c33d9bd0d985 \
--hash=sha256:cb0108391366b3ef336185097b3c2c0f3fa115b15098dafbda5e78aef70ea114
# via -r requirements/pip.in

# WARNING: The following packages were not pinned, but pip requires them to be
# pinned when the requirements file includes hashes. Consider using the --allow-unsafe flag.
# pip
File renamed without changes.
14 changes: 7 additions & 7 deletions requirements.txt → requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --generate-hashes --output-file=requirements.txt requirements.in
# pip-compile --generate-hashes --no-emit-index-url requirements/prod.in
#
attrs==20.3.0 \
--hash=sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6 \
Expand Down Expand Up @@ -88,7 +88,7 @@ eth-utils==1.9.5 \
google-api-core==1.24.1 \
--hash=sha256:0f1dee446db2685863c3c493a90fefa5fc7f4defaf8e1a320b50ccaddfb5d469 \
--hash=sha256:a7f5794446a22ff7d36764959ba5f319f37628faf4da04fdc0dedf1598b556c1
# via -r requirements.in
# via -r requirements/prod.in
google-auth==1.24.0 \
--hash=sha256:0b0e026b412a0ad096e753907559e4bdb180d9ba9f68dd9036164db4fdc4ad2e \
--hash=sha256:ce752cc51c31f479dbf9928435ef4b07514b20261b021c7383bee4bda646acb8
Expand Down Expand Up @@ -144,7 +144,7 @@ grpcio==1.34.0 \
--hash=sha256:f2e4d64675351a058f9cb35fe390ca0956bd2926171bfb7c87596a1ee10ff6ba \
--hash=sha256:f98f746cacbaa681de0bcd90d7aa77b440e3e1327a9988f6a2b580d54e27d4c3 \
--hash=sha256:fa834f4c70b9df83d5af610097747c224513d59af1f03e8c06bca9a7d81fd1a3
# via -r requirements.in
# via -r requirements/prod.in
hexbytes==0.2.1 \
--hash=sha256:123fcf397f52fc7eb34f43ca9a7930a6acfebcabe8ffaef6c7d3520c2356345a \
--hash=sha256:a093a5533aa63ca6614246fa97feb693b5813f9e736c38b68fe4e2d8fcc35aa5
Expand All @@ -169,7 +169,7 @@ jsonschema==3.2.0 \
loguru==0.5.3 \
--hash=sha256:b28e72ac7a98be3d28ad28570299a393dfcd32e5e3f6a353dec94675767b6319 \
--hash=sha256:f8087ac396b5ee5f67c963b495d615ebbceac2796379599820e324419d53667c
# via -r requirements.in
# via -r requirements/prod.in
lru-dict==1.1.6 \
--hash=sha256:365457660e3d05b76f1aba3e0f7fedbfcd6528e97c5115a351ddd0db488354cc
# via web3
Expand All @@ -184,7 +184,7 @@ netaddr==0.8.0 \
notifiers==1.2.1 \
--hash=sha256:171ae79215fcf119e34992ad7e1f95f0709f93997203b3fc6f115b5cedd780a6 \
--hash=sha256:34625af405f4aa19293eaaefe145ccc92c6018ae9798f53a03a7fcc996e541aa
# via -r requirements.in
# via -r requirements/prod.in
parsimonious==0.8.1 \
--hash=sha256:3add338892d580e0cb3b1a39e4a1b427ff9f687858fdd61097053742391a9f6b
# via eth-abi
Expand All @@ -208,7 +208,7 @@ protobuf==3.14.0 \
--hash=sha256:b0d5d35faeb07e22a1ddf8dce620860c8fe145426c02d1a0ae2688c6e8ede36d \
--hash=sha256:ecc33531a213eee22ad60e0e2aaea6c8ba0021f0cce35dbf0ab03dee6e2a23a1
# via
# -r requirements.in
# -r requirements/prod.in
# google-api-core
# googleapis-common-protos
# web3
Expand Down Expand Up @@ -315,7 +315,7 @@ varint==1.0.2 \
web3==5.13.1 \
--hash=sha256:edbd8b2253b875fc8089e0b4cff2084dd11941edc3181666872e0bd74ef27677 \
--hash=sha256:f950d32bc077f09f573bf9d5dcac4ffb3ece9a2017cebb5e451d33df21bedb01
# via -r requirements.in
# via -r requirements/prod.in
websockets==8.1 \
--hash=sha256:0e4fb4de42701340bd2353bb2eee45314651caa6ccee80dbd5f5d5978888fed5 \
--hash=sha256:1d3f1bf059d04a4e0eb4985a887d49195e15ebabc42364f4eb564b1d065793f5 \
Expand Down

0 comments on commit 5ce489b

Please sign in to comment.