Skip to content

Commit 5e6c906

Browse files
Merge pull request #2 from benny-dreamly/sims4-resync-main
Resync the repository with Main AP
2 parents 8afb0a8 + 6f501d2 commit 5e6c906

File tree

2,667 files changed

+440803
-77876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,667 files changed

+440803
-77876
lines changed

.coveragerc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[report]
2+
exclude_lines =
3+
pragma: no cover
4+
if TYPE_CHECKING:
5+
if typing.TYPE_CHECKING:

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
worlds/blasphemous/region_data.py linguist-generated=true
2+
worlds/yachtdice/YachtWeights.py linguist-generated=true

.github/labeler.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'is: documentation':
2+
- changed-files:
3+
- all-globs-to-all-files: '{**/docs/**,**/README.md}'
4+
5+
'affects: webhost':
6+
- changed-files:
7+
- all-globs-to-any-file: 'WebHost.py'
8+
- all-globs-to-any-file: 'WebHostLib/**/*'
9+
10+
'affects: core':
11+
- changed-files:
12+
- all-globs-to-any-file:
13+
- '!*Client.py'
14+
- '!README.md'
15+
- '!LICENSE'
16+
- '!*.yml'
17+
- '!.gitignore'
18+
- '!**/docs/**'
19+
- '!typings/kivy/**'
20+
- '!test/**'
21+
- '!data/**'
22+
- '!.run/**'
23+
- '!.github/**'
24+
- '!worlds_disabled/**'
25+
- '!worlds/**'
26+
- '!WebHost.py'
27+
- '!WebHostLib/**'
28+
- any-glob-to-any-file: # exceptions to the above rules of "stuff that isn't core"
29+
- 'worlds/generic/**/*.py'
30+
- 'worlds/*.py'
31+
- 'CommonClient.py'

.github/pyright-config.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"include": [
3+
"type_check.py",
4+
"../worlds/AutoSNIClient.py",
5+
"../Patch.py"
6+
],
7+
8+
"exclude": [
9+
"**/__pycache__"
10+
],
11+
12+
"stubPath": "../typings",
13+
14+
"typeCheckingMode": "strict",
15+
"reportImplicitOverride": "error",
16+
"reportMissingImports": true,
17+
"reportMissingTypeStubs": true,
18+
19+
"pythonVersion": "3.10",
20+
"pythonPlatform": "Windows",
21+
22+
"executionEnvironments": [
23+
{
24+
"root": ".."
25+
}
26+
]
27+
}

.github/type_check.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from pathlib import Path
2+
import subprocess
3+
4+
config = Path(__file__).parent / "pyright-config.json"
5+
6+
command = ("pyright", "-p", str(config))
7+
print(" ".join(command))
8+
9+
try:
10+
result = subprocess.run(command)
11+
except FileNotFoundError as e:
12+
print(f"{e} - Is pyright installed?")
13+
exit(1)
14+
15+
exit(result.returncode)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Analyze modified files
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**.py"
7+
push:
8+
paths:
9+
- "**.py"
10+
11+
env:
12+
BASE: ${{ github.event.pull_request.base.sha }}
13+
HEAD: ${{ github.event.pull_request.head.sha }}
14+
BEFORE: ${{ github.event.before }}
15+
AFTER: ${{ github.event.after }}
16+
17+
jobs:
18+
flake8-or-mypy:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
task: [flake8, mypy]
23+
24+
name: ${{ matrix.task }}
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: "Determine modified files (pull_request)"
31+
if: github.event_name == 'pull_request'
32+
run: |
33+
git fetch origin $BASE $HEAD
34+
DIFF=$(git diff --diff-filter=d --name-only $BASE...$HEAD -- "*.py")
35+
echo "modified files:"
36+
echo "$DIFF"
37+
echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV
38+
39+
- name: "Determine modified files (push)"
40+
if: github.event_name == 'push' && github.event.before != '0000000000000000000000000000000000000000'
41+
run: |
42+
git fetch origin $BEFORE $AFTER
43+
DIFF=$(git diff --diff-filter=d --name-only $BEFORE..$AFTER -- "*.py")
44+
echo "modified files:"
45+
echo "$DIFF"
46+
echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV
47+
48+
- name: "Treat all files as modified (new branch)"
49+
if: github.event_name == 'push' && github.event.before == '0000000000000000000000000000000000000000'
50+
run: |
51+
echo "diff=." >> $GITHUB_ENV
52+
53+
- uses: actions/setup-python@v5
54+
if: env.diff != ''
55+
with:
56+
python-version: '3.10'
57+
58+
- name: "Install dependencies"
59+
if: env.diff != ''
60+
run: |
61+
python -m pip install --upgrade pip ${{ matrix.task }}
62+
python ModuleUpdate.py --append "WebHostLib/requirements.txt" --force --yes
63+
64+
- name: "flake8: Stop the build if there are Python syntax errors or undefined names"
65+
continue-on-error: false
66+
if: env.diff != '' && matrix.task == 'flake8'
67+
run: |
68+
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics ${{ env.diff }}
69+
70+
- name: "flake8: Lint modified files"
71+
continue-on-error: true
72+
if: env.diff != '' && matrix.task == 'flake8'
73+
run: |
74+
flake8 --count --max-complexity=14 --max-doc-length=120 --max-line-length=120 --statistics ${{ env.diff }}
75+
76+
- name: "mypy: Type check modified files"
77+
continue-on-error: true
78+
if: env.diff != '' && matrix.task == 'mypy'
79+
run: |
80+
mypy --follow-imports=silent --install-types --non-interactive --strict ${{ env.diff }}

.github/workflows/build.yml

+103-28
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,128 @@
22

33
name: Build
44

5-
on: workflow_dispatch
5+
on:
6+
push:
7+
paths:
8+
- '.github/workflows/build.yml'
9+
- 'setup.py'
10+
- 'requirements.txt'
11+
- '*.iss'
12+
pull_request:
13+
paths:
14+
- '.github/workflows/build.yml'
15+
- 'setup.py'
16+
- 'requirements.txt'
17+
- '*.iss'
18+
workflow_dispatch:
619

720
env:
8-
SNI_VERSION: v0.0.88
921
ENEMIZER_VERSION: 7.1
1022
APPIMAGETOOL_VERSION: 13
1123

1224
jobs:
1325
# build-release-macos: # LF volunteer
1426

15-
build-win-py38: # RCs will still be built and signed by hand
27+
build-win: # RCs will still be built and signed by hand
1628
runs-on: windows-latest
1729
steps:
18-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
1931
- name: Install python
20-
uses: actions/setup-python@v3
32+
uses: actions/setup-python@v5
2133
with:
22-
python-version: '3.8'
34+
python-version: '~3.12.7'
35+
check-latest: true
2336
- name: Download run-time dependencies
2437
run: |
25-
Invoke-WebRequest -Uri https://github.com/alttpo/sni/releases/download/${Env:SNI_VERSION}/sni-${Env:SNI_VERSION}-windows-amd64.zip -OutFile sni.zip
26-
Expand-Archive -Path sni.zip -DestinationPath SNI -Force
2738
Invoke-WebRequest -Uri https://github.com/Ijwu/Enemizer/releases/download/${Env:ENEMIZER_VERSION}/win-x64.zip -OutFile enemizer.zip
2839
Expand-Archive -Path enemizer.zip -DestinationPath EnemizerCLI -Force
40+
choco install innosetup --version=6.2.2 --allow-downgrade
2941
- name: Build
3042
run: |
31-
python -m pip install --upgrade pip setuptools
32-
pip install -r requirements.txt
43+
python -m pip install --upgrade pip
3344
python setup.py build_exe --yes
34-
$NAME="$(ls build)".Split('.',2)[1]
45+
if ( $? -eq $false ) {
46+
Write-Error "setup.py failed!"
47+
exit 1
48+
}
49+
$NAME="$(ls build | Select-String -Pattern 'exe')".Split('.',2)[1]
3550
$ZIP_NAME="Archipelago_$NAME.7z"
51+
echo "$NAME -> $ZIP_NAME"
3652
echo "ZIP_NAME=$ZIP_NAME" >> $Env:GITHUB_ENV
3753
New-Item -Path dist -ItemType Directory -Force
3854
cd build
39-
Rename-Item exe.$NAME Archipelago
55+
Rename-Item "exe.$NAME" Archipelago
4056
7z a -mx=9 -mhe=on -ms "../dist/$ZIP_NAME" Archipelago
57+
Rename-Item Archipelago "exe.$NAME" # inno_setup.iss expects the original name
58+
- name: Build Setup
59+
run: |
60+
& "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" inno_setup.iss /DNO_SIGNTOOL
61+
if ( $? -eq $false ) {
62+
Write-Error "Building setup failed!"
63+
exit 1
64+
}
65+
$contents = Get-ChildItem -Path setups/*.exe -Force -Recurse
66+
$SETUP_NAME=$contents[0].Name
67+
echo "SETUP_NAME=$SETUP_NAME" >> $Env:GITHUB_ENV
68+
- name: Check build loads expected worlds
69+
shell: bash
70+
run: |
71+
cd build/exe*
72+
mv Players/Templates/meta.yaml .
73+
ls -1 Players/Templates | sort > setup-player-templates.txt
74+
rm -R Players/Templates
75+
timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
76+
ls -1 Players/Templates | sort > generated-player-templates.txt
77+
cmp setup-player-templates.txt generated-player-templates.txt \
78+
|| diff setup-player-templates.txt generated-player-templates.txt
79+
mv meta.yaml Players/Templates/
80+
- name: Test Generate
81+
shell: bash
82+
run: |
83+
cd build/exe*
84+
cp Players/Templates/Clique.yaml Players/
85+
timeout 30 ./ArchipelagoGenerate
4186
- name: Store 7z
42-
uses: actions/upload-artifact@v2
87+
uses: actions/upload-artifact@v4
4388
with:
4489
name: ${{ env.ZIP_NAME }}
4590
path: dist/${{ env.ZIP_NAME }}
91+
compression-level: 0 # .7z is incompressible by zip
92+
if-no-files-found: error
93+
retention-days: 7 # keep for 7 days, should be enough
94+
- name: Store Setup
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: ${{ env.SETUP_NAME }}
98+
path: setups/${{ env.SETUP_NAME }}
99+
if-no-files-found: error
46100
retention-days: 7 # keep for 7 days, should be enough
47101

48-
build-ubuntu1804:
49-
runs-on: ubuntu-18.04
102+
build-ubuntu2004:
103+
runs-on: ubuntu-20.04
50104
steps:
51105
# - copy code below to release.yml -
52-
- uses: actions/checkout@v2
106+
- uses: actions/checkout@v4
53107
- name: Install base dependencies
54108
run: |
55109
sudo apt update
56110
sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0
57111
sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below
58112
- name: Get a recent python
59-
uses: actions/setup-python@v3
113+
uses: actions/setup-python@v5
60114
with:
61-
python-version: '3.9'
115+
python-version: '~3.12.7'
116+
check-latest: true
62117
- name: Install build-time dependencies
63118
run: |
64-
echo "PYTHON=python3.9" >> $GITHUB_ENV
119+
echo "PYTHON=python3.12" >> $GITHUB_ENV
65120
wget -nv https://github.com/AppImage/AppImageKit/releases/download/$APPIMAGETOOL_VERSION/appimagetool-x86_64.AppImage
66121
chmod a+rx appimagetool-x86_64.AppImage
67122
./appimagetool-x86_64.AppImage --appimage-extract
68123
echo -e '#/bin/sh\n./squashfs-root/AppRun "$@"' > appimagetool
69124
chmod a+rx appimagetool
70125
- name: Download run-time dependencies
71126
run: |
72-
wget -nv https://github.com/alttpo/sni/releases/download/$SNI_VERSION/sni-$SNI_VERSION-manylinux2014-amd64.tar.xz
73-
tar xf sni-*.tar.xz
74-
rm sni-*.tar.xz
75-
mv sni-* SNI
76127
wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z
77128
7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z
78129
- name: Build
@@ -81,26 +132,50 @@ jobs:
81132
# charset-normalizer was somehow incomplete in the github runner
82133
"${{ env.PYTHON }}" -m venv venv
83134
source venv/bin/activate
84-
"${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject setuptools charset-normalizer
85-
pip install -r requirements.txt
135+
"${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject charset-normalizer
86136
python setup.py build_exe --yes bdist_appimage --yes
87137
echo -e "setup.py build output:\n `ls build`"
88138
echo -e "setup.py dist output:\n `ls dist`"
89139
cd dist && export APPIMAGE_NAME="`ls *.AppImage`" && cd ..
90140
export TAR_NAME="${APPIMAGE_NAME%.AppImage}.tar.gz"
91-
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -czvf ../dist/$TAR_NAME Archipelago && mv Archipelago "$DIR_NAME")
141+
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -cv Archipelago | gzip -8 > ../dist/$TAR_NAME && mv Archipelago "$DIR_NAME")
92142
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
93143
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
94144
# - copy code above to release.yml -
145+
- name: Build Again
146+
run: |
147+
source venv/bin/activate
148+
python setup.py build_exe --yes
149+
- name: Check build loads expected worlds
150+
shell: bash
151+
run: |
152+
cd build/exe*
153+
mv Players/Templates/meta.yaml .
154+
ls -1 Players/Templates | sort > setup-player-templates.txt
155+
rm -R Players/Templates
156+
timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
157+
ls -1 Players/Templates | sort > generated-player-templates.txt
158+
cmp setup-player-templates.txt generated-player-templates.txt \
159+
|| diff setup-player-templates.txt generated-player-templates.txt
160+
mv meta.yaml Players/Templates/
161+
- name: Test Generate
162+
shell: bash
163+
run: |
164+
cd build/exe*
165+
cp Players/Templates/Clique.yaml Players/
166+
timeout 30 ./ArchipelagoGenerate
95167
- name: Store AppImage
96-
uses: actions/upload-artifact@v2
168+
uses: actions/upload-artifact@v4
97169
with:
98170
name: ${{ env.APPIMAGE_NAME }}
99171
path: dist/${{ env.APPIMAGE_NAME }}
172+
if-no-files-found: error
100173
retention-days: 7
101174
- name: Store .tar.gz
102-
uses: actions/upload-artifact@v2
175+
uses: actions/upload-artifact@v4
103176
with:
104177
name: ${{ env.TAR_NAME }}
105178
path: dist/${{ env.TAR_NAME }}
179+
compression-level: 0 # .gz is incompressible by zip
180+
if-no-files-found: error
106181
retention-days: 7

0 commit comments

Comments
 (0)