-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #694 from KnowledgeCaptureAndDiscovery/dev
Fix issues about poetry deployment. Update Docker image
- Loading branch information
Showing
10 changed files
with
82 additions
and
142 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 |
---|---|---|
@@ -1,31 +1,34 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# This workflows will upload a Python Package using poetry when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Publish SOMEF package to PyPi | ||
name: Publish SOMEF package to PyPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.x" | ||
- name: Install Poetry | ||
run: curl -sSL https://install.python-poetry.org | python3 - | ||
- name: Update version | ||
run: python update_version.py | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Configure Poetry for PyPI | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_PASSWORD }} | ||
- name: Build and publish | ||
run: | | ||
poetry build | ||
poetry publish |
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 |
---|---|---|
@@ -1,7 +1,19 @@ | ||
from python:3.10 | ||
FROM python:3.10 | ||
|
||
RUN git clone https://github.com/KnowledgeCaptureAndDiscovery/somef | ||
|
||
RUN cd somef && pip install . | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
RUN pip install poetry-plugin-shell | ||
|
||
WORKDIR "/somef" | ||
|
||
RUN poetry install | ||
|
||
RUN poetry run somef configure -a | ||
|
||
RUN echo 'source $(poetry env info --path)/bin/activate' >> ~/.bashrc | ||
|
||
|
||
CMD ["bash", "--login"] | ||
|
||
RUN somef configure -a |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
[tool.poetry] | ||
name = "somef" | ||
version = "0.9.6" | ||
version = "0.9.7" | ||
description = "SOftware Metadata Extraction Framework: A tool for automatically extracting relevant software information from readme files." | ||
authors = ["Daniel Garijo <[email protected]>"] | ||
packages = [ | ||
{ include = "somef", from = "src" } | ||
] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: MIT License", | ||
"Topic :: Software Development :: Libraries :: Python Modules" | ||
|
@@ -20,7 +20,7 @@ bs4 = "^0.0.1" | |
click = "^8.1.7" | ||
click-option-group = "^0.5.6" | ||
matplotlib = "^3.8.2" | ||
nltk = "^3.8.1" | ||
nltk = "^3.9.0" | ||
numpy = "^1.26.3" | ||
pandas = "^2.1.4" | ||
rdflib = "^7.0.0" | ||
|
@@ -41,8 +41,6 @@ rdflib-jsonld = "^0.6.2" | |
requests = "^2.31.0" | ||
scikit-learn = "1.3.2" | ||
|
||
[tool.poetry.dev-dependencies] | ||
|
||
[tool.poetry.scripts] | ||
somef = "somef.__main__:cli" | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
__version__ = "0.9.6" | ||
__version__ = "0.9.7" |
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
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
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,30 @@ | ||
import re | ||
|
||
def get_version(file_path): | ||
"""get version file __init__.py . | ||
Args: | ||
file_path (str): __init__py. | ||
Returns: | ||
str: version. | ||
""" | ||
|
||
with open(file_path, 'r') as f: | ||
for line in f: | ||
if line.startswith('__version__'): | ||
return line.split('=')[1].strip().strip('"') | ||
|
||
|
||
def update_version(toml_path, version_file): | ||
with open(toml_path, 'r') as f: | ||
content = f.read() | ||
|
||
new_version = get_version(version_file) | ||
new_content = content.replace("{version-file}", new_version) | ||
|
||
with open(toml_path, 'w') as f: | ||
f.write(new_content) | ||
|
||
|
||
update_version("pyproject.toml", "src/somef/__init__.py") |