Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build system to prepare for Flatpak release #254

Merged
merged 10 commits into from
Apr 13, 2024
Merged
167 changes: 162 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,168 @@
*~
__pycache__
build-test*
build-ui-*
.vscode
yin_yang/build.py
setup.py

.idea/
# Taken from https://github.com/github/gitignore/blob/main/Python.gitignore
# 12/18/2023

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
.venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
25 changes: 25 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
chase9 marked this conversation as resolved.
Show resolved Hide resolved
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/linux",
"/usr/include/gtk-3.0",
"/usr/include/glib-2.0",
"/usr/lib64/glib-2.0/include",
"/usr/include/pango-1.0",
"/usr/include/harfbuzz",
"/usr/include/cairo",
"/usr/include/gdk-pixbuf-2.0",
"/usr/include/atk-1.0"
],
"defines": [],
"compilerPath": "/usr/lib64/ccache/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[tool.poetry]
name = "yin-yang"
version = "3.3.0"
description = "Auto Nightmode for KDE, Gnome, Budgie, VSCode, Atom and more"
readme = "README.md"
repository = "https://github.com/oskarsh/Yin-Yang"
platforms = ["python3"]
include_package_data = "True"
dependencies = [
"psutil==5.9.5",
"PySide6==6.6.1",
"PySide6-Addons==6.6.1",
"suntime==1.2.5",
"systemd-python==235",
"requests~=2.28.2"
]
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
psutil==5.9.5
PySide6==6.5.3
PySide6-Addons==6.5.3
PySide6==6.6.1
PySide6-Addons==6.6.1
suntime==1.2.5
systemd-python==235
requests~=2.28.2
28 changes: 28 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from setuptools import setup, find_packages

with open("README.md", "r") as fh:
long_description = fh.read()

setup(
name='yin-yang',
version='3.3.0',
url='https://github.com/oskarsh/Yin-Yang',
description='Auto Nightmode for KDE, Gnome, Budgie, VSCode, Atom and more',
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
chase9 marked this conversation as resolved.
Show resolved Hide resolved
install_requires=[
'psutil==5.9.5',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try to collect the dependencies in a single location? With these changes, we would have three different entries to change with an update:

  • requirements.txt
  • setup.py and
  • pyproject.toml.

It would be great if we could just rely on one location.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding of these files is that requirements.txt is for development and setup.py/pyproject.toml is for packaging/distribution, so I think we need to have at least two files? It does appear that pyproject.toml can completely replace setup.py but it is still recommended that both pyproject.toml and setup.py stick around1, but I would appreciate feedback from someone who is more knowledgeable on python packaging then myself.

Footnotes

  1. https://packaging.python.org/en/latest/guides/modernize-setup-py-project/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it appears that the modern recommendation is indeed to forego setup.py in favor of pyproject.toml, if scripting is not needed. I'll work on that now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My latest commit sets up the project to use poetry for building, which means we only need to have pyproject.toml. If you are on board with switching to poetry, I will need to also update the build documentation since the commands will change.

'PySide6==6.6.1',
'PySide6-Addons==6.6.1',
'suntime==1.2.5',
'systemd-python==235',
'requests~=2.28.2'
]
)