Skip to content

Commit 3f17d46

Browse files
committed
chore: move to pyproject and poetry
1 parent 6780b59 commit 3f17d46

File tree

19 files changed

+4276
-473
lines changed

19 files changed

+4276
-473
lines changed

.dockerignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
.*
22
**
33
!renku/**
4-
!setup.py
4+
!pyproject.toml
5+
!poetry.lock
6+
!build.py
57
!*.rst
68
!entrypoint-svc.sh
79
!.git

.github/workflows/test_deploy.yml

+17-22
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Install dependencies
4646
run: |
4747
python -m pip install --upgrade pip
48-
python -m pip install coveralls setuptools wheel
48+
python -m pip install coveralls wheel
4949
python -m pip install .[all]
5050
git config --global --add user.name "Renku @ SDSC"
5151
git config --global --add user.email "[email protected]"
@@ -68,9 +68,8 @@ jobs:
6868
- name: Install dependencies
6969
run: |
7070
python -m pip install --upgrade pip
71-
python -m pip install coveralls setuptools wheel
71+
python -m pip install coveralls poetry wheel
7272
python -m pip install .[all]
73-
python setup.py --version
7473
git config --global --add user.name "Renku @ SDSC"
7574
git config --global --add user.email "[email protected]"
7675
- name: Test docs
@@ -92,10 +91,10 @@ jobs:
9291
- name: Install dependencies
9392
run: |
9493
python -m pip install --upgrade pip
95-
pip install setuptools wheel twine
94+
pip install poetry wheel twine gitpython
9695
python -m pip install .[all]
9796
- name: Build Package
98-
run: python setup.py sdist bdist_wheel
97+
run: poetry build
9998
- name: test with twine
10099
run: twine check dist/*
101100

@@ -121,9 +120,8 @@ jobs:
121120
- name: Install dependencies
122121
run: |
123122
python -m pip install --upgrade pip
124-
python -m pip install coveralls setuptools wheel
123+
python -m pip install coveralls poetry wheel
125124
python -m pip install .[nodocs]
126-
python setup.py --version
127125
git config --global --add user.name "Renku @ SDSC"
128126
git config --global --add user.email "[email protected]"
129127
- name: Test with pytest
@@ -162,9 +160,8 @@ jobs:
162160
- name: Install dependencies
163161
run: |
164162
python -m pip install --upgrade pip
165-
python -m pip install coveralls setuptools wheel
163+
python -m pip install coveralls poetry wheel
166164
python -m pip install .[nodocs]
167-
python setup.py --version
168165
git config --global --add user.name "Renku @ SDSC"
169166
git config --global --add user.email "[email protected]"
170167
- name: Test with pytest
@@ -208,9 +205,8 @@ jobs:
208205
- name: Install dependencies
209206
run: |
210207
python -m pip install --upgrade pip
211-
python -m pip install coveralls setuptools wheel
208+
python -m pip install coveralls poetry wheel
212209
python -m pip install .[nodocs]
213-
python setup.py --version
214210
git config --global --add user.name "Renku @ SDSC"
215211
git config --global --add user.email "[email protected]"
216212
- name: Test with pytest
@@ -254,9 +250,8 @@ jobs:
254250
- name: Install dependencies
255251
run: |
256252
python -m pip install --upgrade pip
257-
python -m pip install coveralls setuptools wheel
253+
python -m pip install coveralls poetry wheel
258254
python -m pip install .[nodocs]
259-
python setup.py --version
260255
git config --global --add user.name "Renku @ SDSC"
261256
git config --global --add user.email "[email protected]"
262257
- name: Test with pytest
@@ -295,7 +290,7 @@ jobs:
295290
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
296291
brew install shellcheck node || brew link --overwrite node
297292
python -m pip install --upgrade pip
298-
python -m pip install setuptools wheel twine
293+
python -m pip install wheel twine
299294
python -m pip install .[all]
300295
git config --global --add user.name "Renku @ SDSC"
301296
git config --global --add user.email "[email protected]"
@@ -328,7 +323,7 @@ jobs:
328323
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
329324
brew install shellcheck node || brew link --overwrite node
330325
python -m pip install --upgrade pip
331-
python -m pip install setuptools wheel twine
326+
python -m pip install wheel twine
332327
python -m pip install .[all]
333328
git config --global --add user.name "Renku @ SDSC"
334329
git config --global --add user.email "[email protected]"
@@ -367,7 +362,7 @@ jobs:
367362
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
368363
brew install shellcheck node || brew link --overwrite node
369364
python -m pip install --upgrade pip
370-
python -m pip install setuptools wheel twine
365+
python -m pip install wheel twine
371366
python -m pip install .[all]
372367
git config --global --add user.name "Renku @ SDSC"
373368
git config --global --add user.email "[email protected]"
@@ -406,7 +401,7 @@ jobs:
406401
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
407402
brew install shellcheck node || brew link --overwrite node
408403
python -m pip install --upgrade pip
409-
python -m pip install setuptools wheel twine
404+
python -m pip install wheel twine
410405
python -m pip install .[all]
411406
git config --global --add user.name "Renku @ SDSC"
412407
git config --global --add user.email "[email protected]"
@@ -439,7 +434,7 @@ jobs:
439434
- name: Install dependencies
440435
run: |
441436
python -m pip install --upgrade pip
442-
python -m pip install coveralls setuptools wheel
437+
python -m pip install coveralls wheel
443438
python -m pip install .[nodocs]
444439
git config --global --add user.name "Renku @ SDSC"
445440
git config --global --add user.email "[email protected]"
@@ -494,7 +489,7 @@ jobs:
494489
- name: Install dependencies
495490
run: |
496491
python -m pip install --upgrade pip
497-
python -m pip install coveralls setuptools wheel
492+
python -m pip install coveralls wheel
498493
python -m pip install .[nodocs]
499494
git config --global --add user.name "Renku @ SDSC"
500495
git config --global --add user.email "[email protected]"
@@ -550,7 +545,7 @@ jobs:
550545
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/43842898fd3ff43273466052722f5ba2789196cb/Formula/git-lfs.rb > git-lfs.rb && brew install git-lfs.rb && rm git-lfs.rb
551546
brew install shellcheck node || brew link --overwrite node
552547
python -m pip install --upgrade pip
553-
python -m pip install setuptools wheel
548+
python -m pip install wheel
554549
python -m pip install .[all]
555550
git config --global --add user.name "Renku @ SDSC"
556551
git config --global --add user.email "[email protected]"
@@ -590,7 +585,7 @@ jobs:
590585
- name: Install dependencies
591586
run: |
592587
python -m pip install --upgrade pip
593-
pip install setuptools wheel twine
588+
pip install poetry wheel twine
594589
python -m pip install .[all]
595590
git config --global --add user.name "Renku @ SDSC"
596591
git config --global --add user.email "[email protected]"
@@ -601,7 +596,7 @@ jobs:
601596
export GIT_TAG=$(renku --version)
602597
git tag $GIT_TAG
603598
- name: Build Package
604-
run: python setup.py sdist bdist_wheel
599+
run: poetry build
605600
- name: Publish a Python distribution to PyPI
606601
uses: pypa/gh-action-pypi-publish@master
607602
with:

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Automatically generated by setuptools_scm
2-
renku/version.py
3-
41
# Byte-compiled / optimized / DLL files
52
__pycache__/
63
.pytest_cache/

.tx/config

-43
This file was deleted.

Dockerfile.cli

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ FROM python:3.7-slim as base
22

33
RUN apt-get update && \
44
apt-get install -y git && \
5-
pip install --no-cache --upgrade pip requirements-builder
5+
pip install --no-cache --upgrade pip poetry
66

77
FROM base as builder
88

99
# The python install is done in two steps to avoid re-installing all dependencies every
1010
# time the code changes
11-
COPY setup.py README.rst CHANGES.rst /code/renku/
12-
COPY renku/version.py.tmpl /code/renku/renku/version.py.tmpl
11+
COPY pyproject.toml build.py poetry.lock README.rst CHANGES.rst /code/renku/
1312
WORKDIR /code/renku
14-
RUN requirements-builder --level=pypi setup.py > /tmp/requirements.txt && \
13+
RUN poetry export --without-hashes -f requirements.txt --output /tmp/requirements.txt && \
1514
pip install -r /tmp/requirements.txt
1615

1716
COPY .git /code/renku/.git

Dockerfile.svc

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ FROM python:3.7-slim as base
22

33
RUN apt-get update && \
44
apt-get install -y git && \
5-
pip install --no-cache --upgrade pip requirements-builder
5+
pip install --no-cache --upgrade pip poetry
66

77
FROM base as builder
88

99
# The python install is done in two steps to avoid re-installing all dependencies every
1010
# time the code changes
11-
COPY setup.py README.rst CHANGES.rst /code/renku/
12-
COPY renku/version.py.tmpl /code/renku/renku/version.py.tmpl
11+
COPY pyproject.toml build.py poetry.lock README.rst CHANGES.rst /code/renku/
1312
WORKDIR /code/renku
14-
RUN requirements-builder -e service --level=pypi setup.py > /tmp/requirements.txt && \
13+
RUN poetry export --without-hashes -f requirements.txt --output /tmp/requirements.txt && \
1514
pip install -r /tmp/requirements.txt
1615

1716
COPY .git /code/renku/.git

MANIFEST.in

-75
This file was deleted.

build.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# Copyright 2017-2021 - Swiss Data Science Center (SDSC)
4+
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
5+
# Eidgenössische Technische Hochschule Zürich (ETHZ).
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
"""Build script executed by Poetry."""
19+
20+
import shutil
21+
from pathlib import Path
22+
from tempfile import TemporaryDirectory
23+
24+
URL = "https://github.com/SwissDataScienceCenter/renku-project-template"
25+
REFERENCE = "0.1.23"
26+
27+
28+
def build() -> None:
29+
from git import Repo
30+
31+
with TemporaryDirectory() as tempdir:
32+
# download and extract template data
33+
print("downloading Renku templates...")
34+
repo = Repo.clone_from(URL, tempdir)
35+
36+
repo.git.checkout(REFERENCE)
37+
38+
# copy templates
39+
current_path = Path.cwd()
40+
template_path = current_path / "renku" / "templates"
41+
build_path = current_path / "build" / "lib" / "renku" / "templates"
42+
if template_path.exists():
43+
shutil.rmtree(str(template_path))
44+
if build_path.exists():
45+
shutil.rmtree(str(build_path))
46+
shutil.copytree(tempdir, str(template_path), ignore=shutil.ignore_patterns(".git"))
47+
shutil.copytree(tempdir, str(build_path), ignore=shutil.ignore_patterns(".git"))
48+
49+
50+
if __name__ == "__main__":
51+
build()

0 commit comments

Comments
 (0)