Skip to content

Commit

Permalink
Initial packages repo design implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Nefo Fortressia <[email protected]>
  • Loading branch information
togetherwithasteria committed Aug 28, 2022
1 parent 1151d7f commit 9571cbb
Show file tree
Hide file tree
Showing 15 changed files with 511 additions and 286 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ __pycache__/

# Distribution / packaging
.Python
build/
./build/
develop-eggs/
dist/
downloads/
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ inquirer = {git = "https://github.com/EchidnaHQ/python-inquirer"}
Jinja2 = "^3.1.2"
click = "^8.1.3"
commentjson = "^0.9.0"
requests = "^2.28.1"

[tool.poetry.dev-dependencies]
pytest = "^6.2"
Expand Down
5 changes: 3 additions & 2 deletions simple_and_kawaii/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from simple_and_kawaii.group import OrderedGroup
from simple_and_kawaii.vscode import vscode_settings
from .init_project import init
from .build import build_deps, __execute_buildsystem, available_buildsystems
from .build import build_deps
from .build.buildsystem import available_buildsystems


@click.group(cls=OrderedGroup)
Expand All @@ -29,7 +30,7 @@ def buildsystems():
help="Run {buildsystem} with Kawaii configurations")
@click.argument("config_args", nargs=-1, type=click.UNPROCESSED)
def execute_{indentname}(config_args):
__execute_buildsystem("{buildsystem}", args=config_args)
execute_buildsystem("{buildsystem}", args=config_args)
cli.add_command(execute_{indentname})
"""
Expand Down
270 changes: 0 additions & 270 deletions simple_and_kawaii/build.py

This file was deleted.

43 changes: 43 additions & 0 deletions simple_and_kawaii/build/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from .download import download_source
from .collections import get_packages
from .build_one import build_one
import asyncio
from hashlib import algorithms_available
import zipfile
import urllib
import tarfile
import requests
import toml
import json
from os import abort, path
import os
from pathlib import Path
import subprocess
import sys
from traceback import print_tb
from typing import Tuple
import click

from simple_and_kawaii.utils import top_level, get_config


@click.command()
def build_deps():
"""Build native libraries required for Waylovely and Portals.\n
Mostly they are written in C/C++. They'll get installed to the '' folder of the root directory of the Git repository!
This behavior can be changed by changing the "deps-location" path in kawaii/cache_config.json file."""
config = get_config()

packages = get_packages(config)

sources = list()
for package in packages:
package_config = package["config"]

if "sources" in package_config:
for source in package_config["sources"].keys():
sources.append((source, package_config["sources"][source]))

with click.progressbar(length=len(sources), label="Downloading sources") as bar:
for source in sources:
download_source(source[0], source[1], path.join(top_level, ".kawaii-sources"), bar)
Loading

0 comments on commit 9571cbb

Please sign in to comment.