Skip to content

Commit

Permalink
Merge branch 'GrafeasGroup:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
erenbektas committed Aug 24, 2022
2 parents 072e751 + 91f6284 commit 2c0c341
Show file tree
Hide file tree
Showing 251 changed files with 1,589 additions and 1,399 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ omit =
blossom/middleware.py,
blossom/instrumentation.py,
blossom/settings/*,
bootstrap/*,
blossom/bootstrap/*,
blossom/social_auth/*,
blossom/conftest.py,
blossom/docs/*
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import-order-style = pycharm
max-complexity = 10
max-line-length = 90
use-varnames-strict-mode = true
exclude = .git,__pycache__,build,dist,.venv,bootstrap/*,*/migrations/,docker/*
exclude = .git,__pycache__,build,dist,.venv,blossom/bootstrap/*,*/migrations/*,docker/*
per-file-ignores =
blossom/settings/routing.py:F401,F403
42 changes: 42 additions & 0 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10.x'
- uses: snok/install-poetry@v1.3.1
with:
virtualenvs-create: true
- name: Install Dependencies
run: |
pip install --upgrade pip
sudo apt-get install libjpeg8 libjpeg-dev libpng-dev libpq-dev -y
poetry install
- name: Add CURRENT_TIME env property
# the smart thing to do here would be to use the commit hash, but
# github releases are ALPHABETIZED, so a commit hash of `abcdef` will
# not be listed as the latest release if `defabc` came before. (╥﹏╥)
run: echo "CURRENT_TIME_VERSION=v$(date '+%s')" >> $GITHUB_ENV
- name: Build the sucker
run: |
sed -i -e "s/?????/${{ env.CURRENT_TIME_VERSION }}/g" blossom/__init__.py
make build
- uses: ncipollo/release-action@v1
with:
artifacts: "build/blossom.pyz"
body: "It's releasin' time"
generateReleaseNotes: true
tag: ${{ env.CURRENT_TIME_VERSION }}
commit: master
token: ${{ secrets.GITHUB_TOKEN }}
45 changes: 0 additions & 45 deletions .github/workflows/bump-version.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/test_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build blossom.pyz and test

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10.x'
- uses: snok/install-poetry@v1.3.1
with:
virtualenvs-create: true
- name: Install Dependencies
run: |
pip install --upgrade pip
sudo apt-get install libjpeg8 libjpeg-dev libpng-dev libpq-dev -y
poetry install
- name: Add CURRENT_TIME env property
# the smart thing to do here would be to use the commit hash, but
# github releases are ALPHABETIZED, so a commit hash of `abcdef` will
# not be listed as the latest release if `defabc` came before. (╥﹏╥)
run: echo "CURRENT_TIME_VERSION=v$(date '+%s')" >> $GITHUB_ENV
- name: Build the sucker
run: |
sed -i -e "s/?????/${{ env.CURRENT_TIME_VERSION }}/g" blossom/__init__.py
make build
- name: Remove source to make sure it doesn't interfere with the tests
run: rm -rf blossom/
- name: Run selfcheck on compiled binary
run: ./build/blossom.pyz selfcheck
14 changes: 5 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@ on: [pull_request]

jobs:
build:
runs-on: ubuntu-18.04
strategy:
max-parallel: 4
matrix:
python-version: [3.9]
runs-on: ubuntu-latest

steps:
- name: Checkout current branch
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1.1.1
python-version: '3.10.x'
- uses: snok/install-poetry@v1.3.1
with:
virtualenvs-create: true
- name: Install Dependencies
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,7 @@ venv.bak/

static/
.idea/*

# packaging artifacts
setup.py
blossom.pyz
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
line_length = 88
multi_line_output = 3
include_trailing_comma = True
known_third_party = beeline,better_exceptions,blossom_wrapper,decorator_include,django,django_filters,dotenv,dpath,drf_yasg,ipware,markdown,mimesis,praw,prawcore,psaw,pytest,pytest_django,pytz,requests,rest_framework,rest_framework_api_key,revproxy,slack,social_core,social_django,stripe,toml
known_third_party = beeline,better_exceptions,blossom_wrapper,click,decorator_include,django,django_filters,dotenv,dpath,drf_yasg,gunicorn,ipware,markdown,mimesis,praw,prawcore,psaw,pytest,pytest_django,pytz,requests,rest_framework,rest_framework_api_key,revproxy,shiv,slack,social_core,social_django,stripe,toml
skip=venv,.venv,env,migrations
3 changes: 0 additions & 3 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
# Unless a later match takes precedence, @global-owner1 and @global-owner2
# will be requested for review when someone opens a pull request.
* @GrafeasGroup/core

*.sh @thelonelyghost
test/* @thelonelyghost
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft blossom
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
setup:
poetry run python manage.py collectstatic --noinput --settings=blossom.settings.testing > /dev/null
poetry run poetry2setup > setup.py

build: setup shiv

clean:
rm setup.py

shiv:
mkdir -p build
poetry run shiv -c blossom -o build/blossom.pyz . --compressed
71 changes: 0 additions & 71 deletions api/tests/slack/commands/test_blacklist.py

This file was deleted.

6 changes: 0 additions & 6 deletions app/apps.py

This file was deleted.

1 change: 0 additions & 1 deletion app/tests.py

This file was deleted.

52 changes: 0 additions & 52 deletions authentication/migrations/0001_initial.py

This file was deleted.

14 changes: 1 addition & 13 deletions blossom/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
"""Metadata about Blossom. Nothing to see here."""

import os

import toml

try:
with open(
os.path.join(os.path.dirname(__file__), "..", "pyproject.toml"), "r"
) as f:
__version__ = toml.load(f)["tool"]["poetry"]["version"]
except OSError:
__version__ = "unknown"
pass
__version__ = "?????" # will be replaced by CI pipeline
File renamed without changes.
2 changes: 1 addition & 1 deletion api/admin.py → blossom/api/admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Configuration for the admin interface of Django."""
from django.contrib import admin

from api.models import Submission, Transcription
from blossom.api.models import Submission, Transcription


class SubmissionAdmin(admin.ModelAdmin):
Expand Down
2 changes: 1 addition & 1 deletion api/apps.py → blossom/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


class ApiConfig(AppConfig):
name = "api"
name = "blossom.api"
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Generated by Django 2.2.12 on 2020-05-06 02:50

import api.models
from django.db import migrations, models
import django.utils.timezone
from django.db import migrations, models

import blossom.api.models


class Migration(migrations.Migration):
Expand Down Expand Up @@ -35,7 +36,9 @@ class Migration(migrations.Migration):
),
(
"original_id",
models.CharField(default=api.models.create_id, max_length=36),
models.CharField(
default=blossom.api.models.create_id, max_length=36
),
),
(
"create_time",
Expand Down

0 comments on commit 2c0c341

Please sign in to comment.