Skip to content

Commit

Permalink
fix: updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
jagalindo committed Jul 29, 2024
1 parent 6bcad39 commit 9d0e0a1
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 29 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/commits.yml
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]
24 changes: 24 additions & 0 deletions .github/workflows/docker-image.yml
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\//}
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
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/*
31 changes: 31 additions & 0 deletions .github/workflows/tests.yml
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ Please note: This is a living document and we will continue to update and improv
Three main interfaces are provided:
* A REST API: The REST API allows for easy integration with other tools and applications. It is also a more user friendly interface for those who are not familiar with the command line.

Whant it to runint, simply run
```bash
pip install flamapy-rest
gunicorn --bind 0.0.0.0:8000 app:app
```

Alternatively, you can use docker in this way:
```bash
chmod +x start-server.sh
./start-server.sh
```
Or go to [the render deployed version]() it isn't fast, but its free.

<p align="right">(<a href="#top">back to top</a>)</p>

Expand Down
Empty file.
5 changes: 5 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pytest
pytest-mock
prospector
mypy
coverage
43 changes: 14 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand All @@ -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
}
)

0 comments on commit 9d0e0a1

Please sign in to comment.