-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (65 loc) · 3.47 KB
/
python-app.yml
File metadata and controls
81 lines (65 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
# - name: Set up Python 3.10
# uses: actions/setup-python@v3
# with:
# python-version: "3.10"
# - name: Install dependencies
# working-directory: ./
# run: |
- name: Build docs
uses: jannekem/run-python-script-action@bbfca66c612a28f3eeca0ae40e1f810265e2ea68
with:
script: |
import os
print("Directory contents:")
for f in os.listdir():
print(f)
from .context import Context
from .errors import InvokedProcessError, RoundupError
from .errors import MissingEnvVarError
from .step import ChangeLogStep as BaseChangeLogStep
from .step import Step, StepName, NullStep, RequirementsStep, DocPublicationStep
from .util import invoke, invokeGIT, TAG_RE, commit, delete_tags, git_config, add_version_label_to_open_bugs
from lasso.releasers._python_version import TextFileDetective
import logging, os, re, shutil
_logger.debug('Python preparation step')
git_config()
shutil.rmtree('venv', ignore_errors=True)
# We add access to system site packages so that projects can save time if they need numpy, pandas, etc.
invoke(['python', '-m', 'venv', '--system-site-packages', 'venv'])
# Do the pseudo-equivalent of ``activate``:
venvBin = os.path.abspath(os.path.join(self.assembly.context.cwd, 'venv', 'bin'))
os.environ['PATH'] = f'{venvBin}:{os.environ["PATH"]}'
# Make sure we have the latest of pip+setuptools+wheel
invoke(['pip', 'install', '--quiet', '--upgrade', 'pip', 'setuptools', 'wheel'])
# #79: ensure that the venv has its own ``sphinx-build``
invoke(['pip', 'install', '--quiet', '--ignore-installed', f'sphinx=={SPHINX_VERSION}'])
# Now install the package being rounded up
invoke(['pip', 'install', '--editable', '.[dev]'])
# ☑️ TODO: what other prep steps are there? What about VERSION.txt overwriting?
# - name: Execute python
# run: |
# python --version
# # sphinx-build docs public -b dirhtml
# shutil.rmtree('venv', ignore_errors=True)
# # We add access to system site packages so that projects can save time if they need numpy, pandas, etc.
# invoke(['python', '-m', 'venv', '--system-site-packages', 'venv'])
# # Do the pseudo-equivalent of ``activate``:
# venvBin = os.path.abspath(os.path.join(self.assembly.context.cwd, 'venv', 'bin'))
# os.environ['PATH'] = f'{venvBin}:{os.environ["PATH"]}'
# # Make sure we have the latest of pip+setuptools+wheel
# invoke(['pip', 'install', '--quiet', '--upgrade', 'pip', 'setuptools', 'wheel'])
# # #79: ensure that the venv has its own ``sphinx-build``
# invoke(['pip', 'install', '--quiet', '--ignore-installed', f'sphinx=={SPHINX_VERSION}'])
# # Now install the package being rounded up
# invoke(['pip', 'install', '--editable', '.[dev]'])
# # ☑️ TODO: what other prep steps are there? What about VERSION.txt overwriting?