mirror of
https://github.com/onionshare/onionshare.git
synced 2025-12-18 09:42:31 -05:00
Make pyproject.toml PEP 621 compliant
- converted tool.poetry to PEP 621 (default behavior for poetry) - converted setup.py to PEP 621 (recommended by setuptools) - use pyproject.toml instead of version.txt - use importlib instead of version.txt - use PEP 621 dependency format in flatpak build scripts - added tomli as a dev dependency (used in build scripts) - removed version.txt (no longer used) - cleaned up dependencies - version is still in desktop/setup.py (unclear on how snapcraft uses it) - poetry lockfiles need to be rebuilt
This commit is contained in:
parent
2cee0508d1
commit
5e89cdcbc4
12 changed files with 197 additions and 175 deletions
|
|
@ -26,9 +26,16 @@ import cx_Freeze
|
|||
from cx_Freeze import setup, Executable
|
||||
from setuptools import find_packages
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
import tomllib
|
||||
else:
|
||||
import tomli as tomllib
|
||||
|
||||
# Discover the version
|
||||
with open(os.path.join("..", "cli", "onionshare_cli", "resources", "version.txt")) as f:
|
||||
version = f.read().strip()
|
||||
pyproject_filename = os.path.join("..", "cli", "pyproject.toml")
|
||||
with open(pyproject_filename, "rb") as f:
|
||||
pyproject = tomllib.load(f)
|
||||
version = pyproject['project']['version']
|
||||
# change a version like 2.6.dev1 to just 2.6, for cx_Freeze's sake
|
||||
last_digit = version[-1]
|
||||
if version.endswith(f".dev{last_digit}"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue