Skip to content

Commit 86fabcd

Browse files
committed
modularize src
+ merge main.py and manage.py + move start logic to swingmusic/__main__.py + add a run.py on the project root
1 parent 76fc97e commit 86fabcd

File tree

171 files changed

+673
-642
lines changed

Some content is hidden

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

171 files changed

+673
-642
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
# python -m poetry install
108108
- name: Build server
109109
run: |
110-
python main.py --build
110+
python run.py --build
111111
env:
112112
SWINGMUSIC_APP_VERSION: ${{ inputs.tag }}
113113
- name: Rename Unix binary

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ RUN pip install bjoern
3535
ARG app_version
3636
ENV SWINGMUSIC_APP_VERSION=$app_version
3737

38-
ENTRYPOINT ["python", "main.py", "--host", "0.0.0.0", "--config", "/config"]
38+
ENTRYPOINT ["python", "run.py", "--host", "0.0.0.0", "--config", "/config"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Mungai Njoroge
3+
Copyright (c) 2025 Mungai Njoroge
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,63 @@ services:
122122
restart: unless-stopped
123123
```
124124
125-
### Contributing
125+
### Contributing and Development
126126
127127
Swing Music is looking for contributors. If you're interested, please join us at the [Swing Music Community](https://t.me/+9n61PFcgKhozZDE0) group on Telegram. For more information, take a look at https://github.com/swing-opensource/swingmusic/issues/186.
128128
129129
[**CONTRIBUTING GUIDELINES**](.github/contributing.md).
130130
131+
> [!TIP]
132+
> This project runs on Python 3.11 or newer and uses [uv](https://docs.astral.sh/uv) to manage dependencies. Please [install uv](https://docs.astral.sh/uv/getting-started/installation/) before continuing for an easy setup.
133+
134+
To set up this project on your computer follow the following steps:
135+
136+
```sh
137+
# 1. Fork the project
138+
139+
git clone https://github.com/swingmx/swingmusic.git
140+
141+
# or via SSH
142+
143+
git clone git@github.com:swingmx/swingmusic.git
144+
```
145+
146+
```sh
147+
# 2. Install dependencies
148+
149+
uv sync
150+
```
151+
152+
```sh
153+
# 3. Install wsgi server
154+
155+
# If you are on Windows, install waitress:
156+
uv add waitress
157+
158+
# If you are on Unix, install bjoern:
159+
uv add bjoern
160+
```
161+
162+
> [!TIP]
163+
> The `libev` package is needed on Linux and MacOS. You can install it on other system as shown:
164+
>
165+
> ```sh
166+
> # Arch Linux
167+
> pacman -S libev
168+
>
169+
> # Fedora, CentOS
170+
> dnf install libev-devel
171+
>
172+
> # MacOS
173+
> brew install libev
174+
> ```
175+
176+
```sh
177+
# 4. Run the program
178+
179+
uv run python run.py
180+
```
181+
131182
### License
132183

133184
This software is provided to you with terms stated in the MIT License. Read the full text in the `LICENSE` file located at the root of this repository.

aarch64_buildscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ cd ../swingmusic
4444
# poetry install
4545
# Swing gives error if this is not set. Set to version of repo you cloned.
4646
export SWINGMUSIC_APP_VERSION="TAG"
47-
python main.py --build
47+
python run.py --build
4848

4949
# rename binary
5050
mv dist/swingmusic dist/swingmusic_linux_arm64

app/serializers/__init__.py

Whitespace-only changes.

build.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

dev_build.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

main.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "swingmusic"
3-
version = "2.0.2"
3+
version = "2.0.6"
44
description = "Swing Music"
55
readme = "README.md"
66
requires-python = ">=3.11, <3.12"
@@ -31,7 +31,6 @@ dependencies = [
3131
"pillow>=11.1.0",
3232
"flask-openapi3==3.0.2",
3333
"rapidfuzz==3.11.0",
34-
"waitress>=3.0.2",
3534
"pendulum>=3.0.0",
3635
"bjoern>=3.2.2",
3736
]

0 commit comments

Comments
 (0)