Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
exclude = .git, .eggs, __pycache__, build, dist, docs, docker, migrations
exclude = .git, .eggs, __pycache__, build, dist, docs, docker, migrations, ui
ignore = E129, E402, F841, W504 E128
max-line-length = 130
22 changes: 17 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ build
# Package files
src/grimoirelab/core/static

# JavaScript files
node_modules
dist
storybook-static

# Local env files
.env.local
.env.*.local

# Log files
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
*storybook.log

# Editor directories and files
.idea
Expand All @@ -31,6 +31,18 @@ yarn-error.log*
.project
.pydevproject
.settings
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
.yarn/*
storybook-static
*.tsbuildinfo

/cypress/videos/
/cypress/screenshots/

# Documentation
.eggs/
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ packages = [

include = [
{ path = "grimoirelab/core/templates" },
{ path = "ui", format = "sdist" },
{ path = "AUTHORS", format = "sdist" },
{ path = "NEWS", format = "sdist" },
{ path = "README.md", format = "sdist" },
]

exclude = [
"ui/tests",
"ui/.storybook",
]

classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -61,6 +67,9 @@ fakeredis = "^2.0.0"
httpretty = "^1.1.4"
flake8 = ">=7.0"

[tool.poetry.build]
script = "scripts/build-ui.py"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
41 changes: 41 additions & 0 deletions scripts/build-ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) GrimoireLab Developers
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import pathlib
import subprocess
import sys


def yarn(*args):
retcode = subprocess.call(["yarn", *list(args)])

if retcode != 0:
sys.exit(retcode)


def build_ui():
ui_dir = pathlib.Path(__file__).parent.parent.joinpath("ui")

sys.stderr.write(f"\nBuilding UI in {ui_dir}\n")
yarn("--cwd", ui_dir.as_posix(), "install")
yarn("--cwd", ui_dir.as_posix(), "build")
sys.stderr.write(f"UI built in {ui_dir}\n\n")


if __name__ == "__main__":
build_ui()