-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
58 lines (52 loc) · 1.92 KB
/
Copy pathsetup.py
File metadata and controls
58 lines (52 loc) · 1.92 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
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
"""
import os
import sys
from pathlib import Path
import setuptools
from offload import VERSION
APP = ["offload/gui.py"]
DATA_FILES = [
"data",
# 'offload/data/report_template.html', 'offload/data/fonts/SourceSans3-Bold.otf',
# 'offload/data/fonts/SourceSans3-BoldIt.otf', 'offload/data/fonts/SourceSans3-It.otf',
# 'offload/data/fonts/SourceSans3-Light.otf', 'offload/data/fonts/SourceSans3-LightIt.otf',
# 'offload/data/fonts/SourceSans3-Regular.otf'
]
OPTIONS = {"iconfile": "data/offload.icns"}
with open("README.md", "r") as fh:
long_description = fh.read()
# py2app 0.28+ errors if install_requires is set. setuptools merges pyproject.toml
# [project].dependencies into install_requires, so temporarily hide pyproject.toml
# during the py2app build (deps are taken from the venv when bundling).
pyproject = Path("pyproject.toml")
pyproject_bak = Path("pyproject.toml.py2app.bak")
if "py2app" in sys.argv and pyproject.exists():
os.rename(pyproject, pyproject_bak)
try:
setuptools.setup(
app=APP,
data_files=DATA_FILES,
options={"py2app": OPTIONS},
name="Offload",
version=VERSION,
author="Probably Outside",
author_email="mail@probablyoutside.com",
description="Transfer files from memory cards and external drives with checksum verification",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/thejoltjoker/offload",
packages=["offload", "tests"],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS",
],
python_requires=">=3.12",
)
finally:
if pyproject_bak.exists():
os.rename(pyproject_bak, pyproject)