-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
160 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Commits Syntax Checker | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, reopened, edited, review_requested, synchronize] | ||
push: | ||
branches: | ||
- "main" | ||
workflow_call: | ||
|
||
jobs: | ||
check: | ||
name: Conventional Commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: webiny/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.* | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build the Docker image | ||
run: docker build . --file Dockerfile --tag flamapy/flamapy-rest:${GITHUB_REF/refs\/tags\//} | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_API_TOKEN }} | ||
- name: Push the Docker image | ||
run: docker push flamapy/flamapy-rest:${GITHUB_REF/refs\/tags\//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Create Release and publish pypi package | ||
permissions: | ||
contents: write | ||
on: | ||
push: | ||
tags: | ||
- v[0-9]+.[0-9]+.* | ||
|
||
jobs: | ||
released: | ||
name: Released | ||
if: github.ref_type == 'tag' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Automated Version Bump | ||
id: changelog | ||
uses: Requarks/changelog-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{github.ref_name}} | ||
writeToFile: 'false' | ||
|
||
- name: Get variables | ||
id: get_variables | ||
run: | | ||
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
echo ::set-output name=IS_PRERELEASE::"${{contains(github.ref, 'dev')}}" | ||
- name: Publish release github | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: ${{ steps.get_variables.outputs.IS_PRERELEASE }} | ||
tag_name: ${{ steps.get_variables.outputs.VERSION }} | ||
body: ${{ steps.changelog.outputs.changes }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish python package | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Pytest Testing Suite | ||
'on': | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- reopened | ||
- edited | ||
- review_requested | ||
- synchronize | ||
push: | ||
branches: | ||
- main | ||
workflow_call: | ||
|
||
jobs: | ||
units: | ||
name: Unitary Testing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
- name: Run unit tests | ||
run: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pytest | ||
pytest-mock | ||
prospector | ||
mypy | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,19 @@ | |
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
def read_requirements(file): | ||
with open(file, "r") as fh: | ||
return fh.read().splitlines() | ||
|
||
# Read requirements from the requirements.txt file | ||
requirements = read_requirements("requirements.txt") | ||
|
||
# Read development requirements from the dev-requirements.txt file | ||
dev_requirements = read_requirements("requirements-dev.txt") | ||
|
||
setuptools.setup( | ||
name="flamapy-fm-dist", | ||
version="1.6.0.dev0", | ||
name="flamapy-rest", | ||
version="2.0.0", | ||
author="Flamapy", | ||
author_email="[email protected]", | ||
description="Flamapy feature model is a distribution of the flama framework containing all plugins required to analyze feature models. It also offers a richier API and a complete command line interface and documentation.", | ||
|
@@ -21,32 +30,8 @@ | |
"Operating System :: OS Independent", | ||
], | ||
python_requires='>=3.9', | ||
install_requires=[ | ||
"wheel", | ||
"Flask", | ||
"gunicorn", | ||
"flamapy~=1.6.0.dev0", | ||
"flamapy-fm~=1.6.0.dev0", | ||
"flamapy-sat~=1.6.0.dev0", | ||
"flask-swagger-ui", | ||
"flask-restplus", | ||
"pytest", | ||
"flask_cors", | ||
"flasgger", | ||
"Fire" | ||
], | ||
install_requires=requirements, | ||
extras_require={ | ||
'dev': [ | ||
'pytest', | ||
'pytest-mock', | ||
'prospector', | ||
'mypy', | ||
'coverage', | ||
] | ||
}, | ||
entry_points={ | ||
'console_scripts': [ | ||
'flamapy-fm-cli = flamapy.interfaces.command_line:flama_fm', | ||
], | ||
}, | ||
'dev': dev_requirements | ||
} | ||
) |