-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathroll.ps1
More file actions
executable file
·60 lines (45 loc) · 1.54 KB
/
roll.ps1
File metadata and controls
executable file
·60 lines (45 loc) · 1.54 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
#!/bin/pwsh
$ErrorActionPreference = "Stop"
# Check if CI environment variable is set to "false"
if ($null -eq $env:CI || "false" -eq $env:CI) {
# testing
pdm export --group testing,crypto-eth-addresses -f requirements -o package/requirements.testing.txt
# tooling
pdm export --group tooling,crypto-eth-addresses -f requirements -o package/requirements.tooling.txt
# mkdocs
# pdm export --group docs-online -f requirements -o package/requirements.mkdocs.txt
# sphinx
pdm export --group docs-offline,crypto-eth-addresses -f requirements -o package/requirements.sphinx.txt
# create environment variable
$env:CI = "true";
}
# Cleanup directories
$venv_dir = "./.venv.dev"
$directories = @($venv_dir, "./build", "./dist")
foreach ($dir in $directories) {
if (Test-Path $dir -PathType Container) {
Remove-Item $dir -Recurse -Force
}
}
# Create venv
python -m venv $venv_dir
$bin_path = "Scripts"
if ($IsLinux || $IsMacOS) {
$bin_path = "bin"
}
# Upgrade pip
& $venv_dir\$bin_path\python -m pip install --upgrade pip
# Install the current package
& $venv_dir\$bin_path\pip install .
# Install sphinx requirements
& $venv_dir\$bin_path\pip install -r package/requirements.sphinx.txt
# Install build tool
& $venv_dir\$bin_path\pip install build
# Activate virtual environment
. $venv_dir\$bin_path\Activate.ps1
# Run export script
python package/export pkg
# Deactivate virtual environment
deactivate
# delete environment variable
$env:CI = "";