Skip to content

Commit fbd5104

Browse files
authored
Merge pull request #63 from octue/widen-dependencies
Widen dependencies
2 parents 48cfb55 + 8d88156 commit fbd5104

24 files changed

+3185
-1658
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo gpg --dearmour -o "
99
gpg --refresh-keys & \
1010
apt-get update -y
1111

12-
# Install the gcloud CLI
13-
# Required for dev builds only
14-
# See https://cloud.google.com/sdk/docs/install#deb
15-
# RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && apt-get update -y && apt-get install google-cloud-cli -y
16-
1712
# Install poetry
1813
USER vscode
1914
ENV POETRY_HOME=/home/vscode/.poetry

.github/workflows/cd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Only trigger when a pull request into main branch is merged
1+
name: cd
2+
23
on:
34
pull_request:
45
types: [closed]
56
branches:
67
- main
7-
workflow_dispatch:
88

99
jobs:
1010
publish:
@@ -13,10 +13,10 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout repository
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1717

1818
- name: Test package is publishable with PyPI test server
19-
uses: JRubics/poetry-publish@v1.16
19+
uses: JRubics/poetry-publish@v1.13
2020
with:
2121
python_version: '3.9'
2222
pypi_token: ${{ secrets.TEST_PYPI_TOKEN }}
@@ -38,7 +38,7 @@ jobs:
3838
needs: [publish]
3939
steps:
4040
- name: Checkout code
41-
uses: actions/checkout@v2
41+
uses: actions/checkout@v3
4242

4343
- name: Install poetry
4444
run: pip install poetry

.github/workflows/ci.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
name: ci
22

33
on:
4+
# Also on push so that codecov reports main branch coverage
5+
push:
6+
branches:
7+
- main
8+
49
pull_request:
10+
types: [opened, synchronize, reopened]
511
branches:
612
- main
13+
714
workflow_dispatch:
815
inputs:
916
debug_enabled:
1017
description: 'Enable tmate debug'
1118
type: boolean
12-
default: 'false'
19+
default: false
1320

1421
jobs:
15-
check-semantic-version:
16-
uses: octue/.github/.github/workflows/reusable-check-semantic-version.yml@main
17-
1822
run-tests:
1923
if: "!contains(github.event.head_commit.message, 'skipci')"
2024
strategy:
@@ -42,10 +46,10 @@ jobs:
4246
4347
steps:
4448
- name: Checkout Repository
45-
uses: actions/checkout@v2
49+
uses: actions/checkout@v3
4650

4751
- name: Setup Python ${{ matrix.python }}
48-
uses: actions/setup-python@v2
52+
uses: actions/setup-python@v3
4953
with:
5054
python-version: ${{ matrix.python }}
5155

@@ -70,8 +74,10 @@ jobs:
7074
- name: Upload coverage to Codecov
7175
# This seems redundant inside the test matrix but actually isn't, since different
7276
# dependency combinations may cause different lines of code to be hit (e.g. backports)
73-
uses: codecov/codecov-action@v1
77+
uses: codecov/codecov-action@v3
7478
with:
75-
file: coverage.xml
76-
fail_ci_if_error: true
79+
files: coverage.xml
80+
fail_ci_if_error: false
81+
# Token is not required for public repos, but see:
82+
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
7783
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1+
# This workflow updates the pull request description with an auto-generated section containing the categorised commit
2+
# message headers of the commits since the last pull request merged into main. The auto generated section is enveloped
3+
# between two comments: "<!--- START AUTOGENERATED NOTES --->" and "<!--- END AUTOGENERATED NOTES --->". Anything
4+
# outside these in the description is left untouched. Auto-generated updates can be skipped for a commit if
5+
# "<!--- SKIP AUTOGENERATED NOTES --->" is added to the pull request description.
6+
17
name: update-pull-request
28

3-
on:
4-
pull_request:
5-
branches:
6-
- main
9+
on: pull_request
710

811
jobs:
9-
update-pull-request:
10-
uses: octue/.github/.github/workflows/reusable-update-pull-request.yml@main
12+
description:
13+
uses: octue/workflows/.github/workflows/generate-pull-request-description.yml@main
1114
secrets:
1215
token: ${{ secrets.GITHUB_TOKEN }}
16+
permissions:
17+
contents: read
18+
pull-requests: write

ATTRIBUTION.md

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,215 @@ modification, are permitted provided that the following conditions are met:
370370
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
371371

372372
</details>
373+
374+
## gcp-pilot
375+
376+
We've brought code from
377+
[here](https://github.com/flamingo-run/gcp-pilot/blob/0.40.1/LICENSE.md) which does not have a valid license file because the copyright isn't entered. However, they've attempted to use Apache 2.0 so here is our best effort to comply:
378+
379+
<details>
380+
<summary>Show license</summary>
381+
382+
Apache License
383+
Version 2.0, January 2004
384+
http://www.apache.org/licenses/
385+
386+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
387+
388+
1. Definitions.
389+
390+
"License" shall mean the terms and conditions for use, reproduction,
391+
and distribution as defined by Sections 1 through 9 of this document.
392+
393+
"Licensor" shall mean the copyright owner or entity authorized by
394+
the copyright owner that is granting the License.
395+
396+
"Legal Entity" shall mean the union of the acting entity and all
397+
other entities that control, are controlled by, or are under common
398+
control with that entity. For the purposes of this definition,
399+
"control" means (i) the power, direct or indirect, to cause the
400+
direction or management of such entity, whether by contract or
401+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
402+
outstanding shares, or (iii) beneficial ownership of such entity.
403+
404+
"You" (or "Your") shall mean an individual or Legal Entity
405+
exercising permissions granted by this License.
406+
407+
"Source" form shall mean the preferred form for making modifications,
408+
including but not limited to software source code, documentation
409+
source, and configuration files.
410+
411+
"Object" form shall mean any form resulting from mechanical
412+
transformation or translation of a Source form, including but
413+
not limited to compiled object code, generated documentation,
414+
and conversions to other media types.
415+
416+
"Work" shall mean the work of authorship, whether in Source or
417+
Object form, made available under the License, as indicated by a
418+
copyright notice that is included in or attached to the work
419+
(an example is provided in the Appendix below).
420+
421+
"Derivative Works" shall mean any work, whether in Source or Object
422+
form, that is based on (or derived from) the Work and for which the
423+
editorial revisions, annotations, elaborations, or other modifications
424+
represent, as a whole, an original work of authorship. For the purposes
425+
of this License, Derivative Works shall not include works that remain
426+
separable from, or merely link (or bind by name) to the interfaces of,
427+
the Work and Derivative Works thereof.
428+
429+
"Contribution" shall mean any work of authorship, including
430+
the original version of the Work and any modifications or additions
431+
to that Work or Derivative Works thereof, that is intentionally
432+
submitted to Licensor for inclusion in the Work by the copyright owner
433+
or by an individual or Legal Entity authorized to submit on behalf of
434+
the copyright owner. For the purposes of this definition, "submitted"
435+
means any form of electronic, verbal, or written communication sent
436+
to the Licensor or its representatives, including but not limited to
437+
communication on electronic mailing lists, source code control systems,
438+
and issue tracking systems that are managed by, or on behalf of, the
439+
Licensor for the purpose of discussing and improving the Work, but
440+
excluding communication that is conspicuously marked or otherwise
441+
designated in writing by the copyright owner as "Not a Contribution."
442+
443+
"Contributor" shall mean Licensor and any individual or Legal Entity
444+
on behalf of whom a Contribution has been received by Licensor and
445+
subsequently incorporated within the Work.
446+
447+
2. Grant of Copyright License. Subject to the terms and conditions of
448+
this License, each Contributor hereby grants to You a perpetual,
449+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
450+
copyright license to reproduce, prepare Derivative Works of,
451+
publicly display, publicly perform, sublicense, and distribute the
452+
Work and such Derivative Works in Source or Object form.
453+
454+
3. Grant of Patent License. Subject to the terms and conditions of
455+
this License, each Contributor hereby grants to You a perpetual,
456+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
457+
(except as stated in this section) patent license to make, have made,
458+
use, offer to sell, sell, import, and otherwise transfer the Work,
459+
where such license applies only to those patent claims licensable
460+
by such Contributor that are necessarily infringed by their
461+
Contribution(s) alone or by combination of their Contribution(s)
462+
with the Work to which such Contribution(s) was submitted. If You
463+
institute patent litigation against any entity (including a
464+
cross-claim or counterclaim in a lawsuit) alleging that the Work
465+
or a Contribution incorporated within the Work constitutes direct
466+
or contributory patent infringement, then any patent licenses
467+
granted to You under this License for that Work shall terminate
468+
as of the date such litigation is filed.
469+
470+
4. Redistribution. You may reproduce and distribute copies of the
471+
Work or Derivative Works thereof in any medium, with or without
472+
modifications, and in Source or Object form, provided that You
473+
meet the following conditions:
474+
475+
(a) You must give any other recipients of the Work or
476+
Derivative Works a copy of this License; and
477+
478+
(b) You must cause any modified files to carry prominent notices
479+
stating that You changed the files; and
480+
481+
(c) You must retain, in the Source form of any Derivative Works
482+
that You distribute, all copyright, patent, trademark, and
483+
attribution notices from the Source form of the Work,
484+
excluding those notices that do not pertain to any part of
485+
the Derivative Works; and
486+
487+
(d) If the Work includes a "NOTICE" text file as part of its
488+
distribution, then any Derivative Works that You distribute must
489+
include a readable copy of the attribution notices contained
490+
within such NOTICE file, excluding those notices that do not
491+
pertain to any part of the Derivative Works, in at least one
492+
of the following places: within a NOTICE text file distributed
493+
as part of the Derivative Works; within the Source form or
494+
documentation, if provided along with the Derivative Works; or,
495+
within a display generated by the Derivative Works, if and
496+
wherever such third-party notices normally appear. The contents
497+
of the NOTICE file are for informational purposes only and
498+
do not modify the License. You may add Your own attribution
499+
notices within Derivative Works that You distribute, alongside
500+
or as an addendum to the NOTICE text from the Work, provided
501+
that such additional attribution notices cannot be construed
502+
as modifying the License.
503+
504+
You may add Your own copyright statement to Your modifications and
505+
may provide additional or different license terms and conditions
506+
for use, reproduction, or distribution of Your modifications, or
507+
for any such Derivative Works as a whole, provided Your use,
508+
reproduction, and distribution of the Work otherwise complies with
509+
the conditions stated in this License.
510+
511+
5. Submission of Contributions. Unless You explicitly state otherwise,
512+
any Contribution intentionally submitted for inclusion in the Work
513+
by You to the Licensor shall be under the terms and conditions of
514+
this License, without any additional terms or conditions.
515+
Notwithstanding the above, nothing herein shall supersede or modify
516+
the terms of any separate license agreement you may have executed
517+
with Licensor regarding such Contributions.
518+
519+
6. Trademarks. This License does not grant permission to use the trade
520+
names, trademarks, service marks, or product names of the Licensor,
521+
except as required for reasonable and customary use in describing the
522+
origin of the Work and reproducing the content of the NOTICE file.
523+
524+
7. Disclaimer of Warranty. Unless required by applicable law or
525+
agreed to in writing, Licensor provides the Work (and each
526+
Contributor provides its Contributions) on an "AS IS" BASIS,
527+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
528+
implied, including, without limitation, any warranties or conditions
529+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
530+
PARTICULAR PURPOSE. You are solely responsible for determining the
531+
appropriateness of using or redistributing the Work and assume any
532+
risks associated with Your exercise of permissions under this License.
533+
534+
8. Limitation of Liability. In no event and under no legal theory,
535+
whether in tort (including negligence), contract, or otherwise,
536+
unless required by applicable law (such as deliberate and grossly
537+
negligent acts) or agreed to in writing, shall any Contributor be
538+
liable to You for damages, including any direct, indirect, special,
539+
incidental, or consequential damages of any character arising as a
540+
result of this License or out of the use or inability to use the
541+
Work (including but not limited to damages for loss of goodwill,
542+
work stoppage, computer failure or malfunction, or any and all
543+
other commercial damages or losses), even if such Contributor
544+
has been advised of the possibility of such damages.
545+
546+
9. Accepting Warranty or Additional Liability. While redistributing
547+
the Work or Derivative Works thereof, You may choose to offer,
548+
and charge a fee for, acceptance of support, warranty, indemnity,
549+
or other liability obligations and/or rights consistent with this
550+
License. However, in accepting such obligations, You may act only
551+
on Your own behalf and on Your sole responsibility, not on behalf
552+
of any other Contributor, and only if You agree to indemnify,
553+
defend, and hold each Contributor harmless for any liability
554+
incurred by, or claims asserted against, such Contributor by reason
555+
of your accepting any such warranty or additional liability.
556+
557+
END OF TERMS AND CONDITIONS
558+
559+
APPENDIX: How to apply the Apache License to your work.
560+
561+
To apply the Apache License to your work, attach the following
562+
boilerplate notice, with the fields enclosed by brackets "{}"
563+
replaced with your own identifying information. (Don't include
564+
the brackets!) The text should be enclosed in the appropriate
565+
comment syntax for the file format. We also recommend that a
566+
file or class name and description of purpose be included on the
567+
same "printed page" as the copyright notice for easier
568+
identification within third-party archives.
569+
570+
Copyright {yyyy} {name of copyright owner}
571+
572+
Licensed under the Apache License, Version 2.0 (the "License");
573+
you may not use this file except in compliance with the License.
574+
You may obtain a copy of the License at
575+
576+
http://www.apache.org/licenses/LICENSE-2.0
577+
578+
Unless required by applicable law or agreed to in writing, software
579+
distributed under the License is distributed on an "AS IS" BASIS,
580+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
581+
See the License for the specific language governing permissions and
582+
limitations under the License.
583+
584+
</details>

django_gcp/tasks/_patch_cloud_scheduler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from gcp_pilot.base import GoogleCloudPilotAPI
2-
from gcp_pilot.scheduler import CloudScheduler as BaseCloudScheduler
1+
from ._pilot.base import GoogleCloudPilotAPI
2+
from ._pilot.scheduler import CloudScheduler as BaseCloudScheduler
33

44

55
class CloudScheduler(BaseCloudScheduler):

django_gcp/tasks/_patch_cloud_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from gcp_pilot.base import GoogleCloudPilotAPI
2-
from gcp_pilot.tasks import CloudTasks as BaseCloudTasks
1+
from ._pilot.base import GoogleCloudPilotAPI
2+
from ._pilot.tasks import CloudTasks as BaseCloudTasks
33

44

55
class CloudTasks(BaseCloudTasks):

django_gcp/tasks/_pilot/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# About Pilot
2+
3+
This module is extracted from gcp_pilot, a third party library.
4+
5+
We were relying on gcp_pilot, which is mostly well engineered, to provide a better abstraction than the google cloud apis themselves. However,
6+
the authors of gcp_pilot keep shifting their python dependency range - it's super tight for no clear reason and that prevents downstream users
7+
from being abole to maintain systems. It's a headache.
8+
9+
We also have the probelm that they don't bother producing any release notes, so updating is a bear.
10+
11+
But, we've got very little time right now, so are simply porting some of their code here for the time being to overcome the dependency problems.
12+
We will come back and refacotr the required aspects to remove this private module.

django_gcp/tasks/_pilot/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)