Skip to content

Commit bf0856c

Browse files
tiagolvCopilot
andauthored
Yake Refactoring .3 (#92)
* Create super-linter.yml Teste de linting nos ficheiros atuais do yake * Create pylint.yml testes gerais * atualização das imagens das dockers * yake.py 60% refatorização inicial do programa principal * Create resultados.yml criado workflow para verificar resultados * Update resultados.yml atualização resultados.yml * Update resultados.yml atualizado resultados.yml * pyint espaços + atualização de status * link code testes * Levenshtein refatorização inicial * clip.py - initial refactoring atualizado status adicionados ficheiros originais para comparações * removidos ficheiros originais Removidos ficheiros originais, pois estavam a interferir com o score do teste pylint * cli.py atualizado * trailing whitespaces * highlight refatorização inicial * highlight.py lines * highlight.py docstrings * datarepresentation.py formatação inicial highligths.py 90% * datarepresentatio 40% * datarepresentation linting * datarepresentation 70% só falta refatorar variáveis, reconstruir métodos e documentação * variaveis * + variables * 25/02/2025 acabado * teste yake.py métodos * yake.py métodos e atributos distribuidos * yake.py 100% Refactored and optimized * separação de métodos highlight.py * documentação beta highlight.py * + documentação * highlights.py 90% + documentação * highlight.py criação de dicioários * 07/03/2025 fim * Update yakenew.md up * actions files * Create Makefile * Update requirements.txt * actions mais abrangentes * Update requirements.txt * Update Makefile * Update Makefile * dicionários e sesepararção final de argumentos e métodos * continuação do ultimo commit * dicionarios compativeis e teste de novas classes * Update Makefile * datarepresentation lint * extensão das novas classes de contexto * teste de nova classes de contexto * datarep new approach * datarep * estruta mais simples * voltada a usar datarep com menos complexidade temporal * datarepresentation refactored 100% * -DOCCKER files - rest api expirada * updated ymls * docs-sites inicio * data-site setup finished * Adiciona versão estática para GitHub Pages * docs site estatico * style * cortes e organização de repositório * workflow para atualização do site * Update deploy.yml * Update deploy.yml * ccs do site * updated layout * Update README.md * added search back to page * updated mdx for cleaner look * updated gitignore * Update package.json * Update layout.tsx * Update layout.config.tsx * cleaned pke and updated logo layout * Update config.ts * Update layout.config.tsx * Update layout.config.tsx * updated documentation * moved core files to core folder * Update README.md * cleaning repository and read-me tests * Update README.md * updated homepage and readme * updated homepage doc site * Update README.md * updating homepage and doc site links * homepage final form * cleaning up and link redirection working * doc site update * updated index * Update yake.mdx * updated home.mdx * final docs website structure * Update about.mdx * Update about.mdx * compatibility error * index * updated formattting * icon test * docs * added notebook * updated collab redirections and notebook * Create meta.json * updated order * Delete meta.json * Update getting-started.mdx * Update README.md * sidebar test * teste sidebar * _meta * updated sidebar * sidebar final config * updated utils and homepage * Update README.md * updated main class documentation * changed to uv * finishing touches * updated workflows for uv * v envs for workflows * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * updated workflows * final formatting for pull request --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0fa58cc commit bf0856c

155 files changed

Lines changed: 37114 additions & 13734 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Create Release on PR Merge
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
branches:
8+
- master # Change to your default branch if different (e.g., master)
9+
workflow_dispatch:
10+
11+
jobs:
12+
create_release:
13+
# Only run when PR is merged (not when just closed)
14+
if: github.event.pull_request.merged == true
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write # Needed for creating releases
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0 # Fetch all history for proper versioning and commit messages
23+
24+
- name: Get latest release version
25+
id: get_version
26+
run: |
27+
# Get latest tag or set to v0.0.0 if none exists
28+
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
29+
echo "LATEST_TAG=${LATEST_TAG}" >> $GITHUB_ENV
30+
31+
# Extract version numbers
32+
MAJOR=$(echo $LATEST_TAG | sed 's/v\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/')
33+
MINOR=$(echo $LATEST_TAG | sed 's/v\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/')
34+
PATCH=$(echo $LATEST_TAG | sed 's/v\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/')
35+
36+
# Check PR labels to determine which version to increment
37+
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'major') }}" == "true" ]]; then
38+
echo "Incrementing MAJOR version due to 'major' label"
39+
MAJOR=$((MAJOR + 1))
40+
MINOR=0
41+
PATCH=0
42+
elif [[ "${{ contains(github.event.pull_request.labels.*.name, 'minor') }}" == "true" ]]; then
43+
echo "Incrementing MINOR version due to 'minor' label"
44+
MINOR=$((MINOR + 1))
45+
PATCH=0
46+
else
47+
echo "Incrementing PATCH version (default)"
48+
PATCH=$((PATCH + 1))
49+
fi
50+
51+
NEW_TAG="v$MAJOR.$MINOR.$PATCH"
52+
echo "Bumping version from $LATEST_TAG to $NEW_TAG"
53+
echo "NEW_TAG=${NEW_TAG}" >> $GITHUB_ENV
54+
55+
- name: Generate Release Notes
56+
id: release_notes
57+
run: |
58+
# Get commits since last tag
59+
echo "Generating commit list since $LATEST_TAG"
60+
COMMITS=$(git log --pretty=format:"- %s (%h)" ${{ env.LATEST_TAG }}..HEAD)
61+
62+
# Extract PR details
63+
PR_TITLE="${{ github.event.pull_request.title }}"
64+
PR_NUMBER="${{ github.event.pull_request.number }}"
65+
PR_BODY="${{ github.event.pull_request.body }}"
66+
PR_USER="${{ github.event.pull_request.merged_by.login }}"
67+
68+
# Save release notes to environment variable
69+
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
70+
echo "## Release ${{ env.NEW_TAG }}" >> $GITHUB_ENV
71+
echo "" >> $GITHUB_ENV
72+
echo "### 🔄 Pull Request" >> $GITHUB_ENV
73+
echo "- #$PR_NUMBER: $PR_TITLE" >> $GITHUB_ENV
74+
echo "- Merged by @$PR_USER" >> $GITHUB_ENV
75+
echo "" >> $GITHUB_ENV
76+
77+
if [[ -n "$PR_BODY" ]]; then
78+
echo "### 📝 Description" >> $GITHUB_ENV
79+
echo "$PR_BODY" >> $GITHUB_ENV
80+
echo "" >> $GITHUB_ENV
81+
fi
82+
83+
echo "### 📦 Changes" >> $GITHUB_ENV
84+
echo "$COMMITS" >> $GITHUB_ENV
85+
echo "EOF" >> $GITHUB_ENV
86+
87+
- name: Create Release
88+
uses: softprops/action-gh-release@v1
89+
with:
90+
tag_name: ${{ env.NEW_TAG }}
91+
name: Release ${{ env.NEW_TAG }}
92+
body: ${{ env.RELEASE_NOTES }}
93+
draft: false # Set to true if you want to review before publishing
94+
prerelease: false # Set to true for pre-releases
95+
# If you have build artifacts to include, uncomment and modify this:
96+
# files: |
97+
# dist/*.zip
98+
# dist/*.tar.gz
99+
env:
100+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101+
102+
- name: Output Results
103+
run: |
104+
echo "::notice::🎉 Created release ${{ env.NEW_TAG }} from PR #${{ github.event.pull_request.number }}"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Set up Python 3.9
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.9
15+
- name: Install pypa/build
16+
run: >-
17+
python -m
18+
pip install
19+
build
20+
--user
21+
- name: Build a binary wheel and a source tarball
22+
run: >-
23+
python -m
24+
build
25+
--sdist
26+
--wheel
27+
--outdir dist/
28+
.
29+
- name: Publish distribution 📦 to Test PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
33+
repository_url: https://test.pypi.org/legacy/
34+
skip_existing: true
35+
- name: Publish distribution 📦 to PyPI
36+
if: startsWith(github.ref, 'refs/tags')
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
password: ${{ secrets.PYPI_API_TOKEN }}"
40+
41+
#Não funciona pq não tenho secret keys

.github/workflows/deploy.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- core-seperation # ou master, dependendo da sua branch principal
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '18'
19+
20+
- name: Install dependencies
21+
run: |
22+
cd docs-site
23+
npm ci
24+
25+
- name: Build
26+
run: |
27+
cd docs-site
28+
npm run build
29+
30+
- name: Create .nojekyll file
31+
run: |
32+
touch docs-site/out/.nojekyll
33+
34+
- name: Deploy
35+
uses: JamesIves/github-pages-deploy-action@v4
36+
with:
37+
folder: docs-site/out
38+
branch: gh-pages

.github/workflows/format.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
- name: Install uv
20+
run: pip install uv
21+
- name: Create virtual environment
22+
run: uv venv
23+
- name: Install dependencies
24+
run: |
25+
uv pip install -e ".[dev]"
26+
uv pip install black
27+
- name: format
28+
run: uv run black --check .

.github/workflows/install.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Install
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
- name: Install uv
19+
run: pip install uv
20+
- name: Create virtual environment
21+
run: uv venv
22+
- name: Install package
23+
run: uv pip install -e .

.github/workflows/lint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: '3.10'
18+
- name: Install uv
19+
run: pip install uv
20+
- name: Create virtual environment
21+
run: uv venv
22+
- name: Install dependencies
23+
run: |
24+
uv pip install -e ".[dev]"
25+
uv pip install ruff flake8
26+
- name: lint
27+
run: |
28+
uv run ruff check --fix .
29+
uv run ruff check .
30+
uv run flake8 yake/

.github/workflows/publishpypi.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Set up Python 3.9
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.9
15+
- name: Install pypa/build
16+
run: >-
17+
python -m
18+
pip install
19+
build
20+
--user
21+
- name: Build a binary wheel and a source tarball
22+
run: >-
23+
python -m
24+
build
25+
--sdist
26+
--wheel
27+
--outdir dist/
28+
.
29+
- name: Publish distribution 📦 to Test PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
33+
repository_url: https://test.pypi.org/legacy/
34+
skip_existing: true
35+
- name: Publish distribution 📦 to PyPI
36+
if: startsWith(github.ref, 'refs/tags')
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
password: ${{ secrets.PYPI_API_TOKEN }}
40+
"
41+
42+
#não está a funcionar pq não tenho as secret keys

.github/workflows/pylint.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Pylint
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8", "3.9", "3.10"]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install pylint
21+
- name: Analysing the code with pylint
22+
run: |
23+
pylint $(git ls-files '*.py')

0 commit comments

Comments
 (0)