Skip to content

Commit

Permalink
fix package naming and create test-release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
vzickner committed Nov 8, 2023
1 parent 4d5031e commit c21a7b2
Show file tree
Hide file tree
Showing 20 changed files with 77 additions and 104 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name: Publish Package to PyPi
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
Expand All @@ -21,6 +22,9 @@ jobs:
- run: source venv/bin/activate
- run: pip install setuptools
- run: python setup.py sdist
- run: pip wheel . -w dist
- run: python -m pip install --upgrade twine
- run: twine upload dist/*
- run: pip wheel --no-deps . -w dist
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
verbose: true
32 changes: 32 additions & 0 deletions .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Package to Test PyPi

on:
release:
types: [released]

jobs:
build:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12.0
uses: actions/setup-python@v4
with:
python-version: 3.12.0
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- run: pip install virtualenv
- run: virtualenv venv
- run: source venv/bin/activate
- run: pip install setuptools
- run: python setup.py sdist
- run: pip wheel --no-deps . -w dist
- name: Publish package distributions to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist/
verbose: true
71 changes: 0 additions & 71 deletions .gitlab-ci.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ The usage with Flowable Cloud is simpler, since everything is pre-configured.
However, it's required to either use the user credentials or to pre-configure a personal access token.

```python
from flowableexternalworker import ExternalWorkerClient
from flowableexternalworker.cloud_token import FlowableCloudToken
from flowable.external_worker_client import ExternalWorkerClient
from flowable.external_worker_client.cloud_token import FlowableCloudToken

client = ExternalWorkerClient(auth=FlowableCloudToken("<personal-access-token>"))

Expand All @@ -46,7 +46,7 @@ subscription = client.subscribe('myTopic', my_callback)
The following is an example how you can connect to a Flowable instance running at `http://host.docker.internal:8090` and process all messages retrieved on the topic `myTopic`:

```python
from flowableexternalworker import ExternalWorkerClient
from flowable.external_worker_client import ExternalWorkerClient
from requests.auth import HTTPBasicAuth

client = ExternalWorkerClient('http://localhost:8090/flowable-work', auth=HTTPBasicAuth("admin", "test"))
Expand Down
Empty file added flowable/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from requests import Session
from requests.auth import AuthBase

from flowableexternalworker.engine_rest_variable import EngineRestVariable
from flowableexternalworker.external_worker_acquire_job_response import ExternalWorkerAcquireJobResponse
from flowableexternalworker.restclient import FlowableExternalWorkerRestClient
from flowableexternalworker.worker_result import WorkerResultSuccess, WorkerResultFailure, WorkerResultBpmnError, WorkerResultCmmnTerminate, WorkResult
from flowable.external_worker_client.engine_rest_variable import EngineRestVariable
from flowable.external_worker_client.external_worker_acquire_job_response import ExternalWorkerAcquireJobResponse
from flowable.external_worker_client.restclient import FlowableExternalWorkerRestClient
from flowable.external_worker_client.worker_result import WorkerResultSuccess, WorkerResultFailure, WorkerResultBpmnError, WorkerResultCmmnTerminate, WorkResult


class WorkerResultBuilder(object):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flowableexternalworker.engine_rest_variable import EngineRestVariable
from flowableexternalworker.external_worker_job_response import ExternalWorkerJobResponse
from flowable.external_worker_client.engine_rest_variable import EngineRestVariable
from flowable.external_worker_client.external_worker_job_response import ExternalWorkerJobResponse


class ExternalWorkerAcquireJobResponse(ExternalWorkerJobResponse):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flowableexternalworker.engine_rest_variable import EngineRestVariable
from flowable.external_worker_client.engine_rest_variable import EngineRestVariable


def convert_from_engine_rest_variable(o: EngineRestVariable) -> object:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from flowableexternalworker.engine_rest_variable import EngineRestVariable
from flowableexternalworker.external_worker_acquire_job_response import ExternalWorkerAcquireJobResponse
from flowableexternalworker.external_worker_job_response import ExternalWorkerJobResponse
from flowableexternalworker.utils import parse_date_time
from flowable.external_worker_client.engine_rest_variable import EngineRestVariable
from flowable.external_worker_client.external_worker_acquire_job_response import ExternalWorkerAcquireJobResponse
from flowable.external_worker_client.external_worker_job_response import ExternalWorkerJobResponse
from flowable.external_worker_client.utils import parse_date_time


def convert_to_external_worker_job_response(o) -> ExternalWorkerJobResponse:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
from requests import Session
from requests.auth import AuthBase

from flowableexternalworker import response_converter
from flowableexternalworker.engine_rest_variable import EngineRestVariable
from flowableexternalworker.external_worker_acquire_job_response import ExternalWorkerAcquireJobResponse
from flowableexternalworker.external_worker_job_response import ExternalWorkerJobResponse
from flowableexternalworker.flowable_rest_exception import FlowableRestException
from flowableexternalworker.list_result import ListResult
from flowableexternalworker.request_converter import convert_from_engine_rest_variable
from flowable.external_worker_client import response_converter
from flowable.external_worker_client.engine_rest_variable import EngineRestVariable
from flowable.external_worker_client.external_worker_acquire_job_response import ExternalWorkerAcquireJobResponse
from flowable.external_worker_client.external_worker_job_response import ExternalWorkerJobResponse
from flowable.external_worker_client.flowable_rest_exception import FlowableRestException
from flowable.external_worker_client.list_result import ListResult
from flowable.external_worker_client.request_converter import convert_from_engine_rest_variable

JOB_API = '/external-job-api'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations
from abc import abstractmethod

from flowableexternalworker import ExternalWorkerAcquireJobResponse, EngineRestVariable
from flowableexternalworker.restclient import FlowableExternalWorkerRestClient
from flowable.external_worker_client import ExternalWorkerAcquireJobResponse, EngineRestVariable
from flowable.external_worker_client.restclient import FlowableExternalWorkerRestClient


class WorkResult(object):
Expand Down
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
from setuptools import find_packages, setup

# read the contents of your README file
from pathlib import Path

this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

setup(
name='flowable.external-worker-client',
packages=find_packages(include=['flowable.external-worker-client']),
version='1.0.dev1',
packages=['flowable', 'flowable.external_worker_client'],
version='1.0.dev6',
description='Flowable External Worker Library to connect Python code to Flowable using an external worker.',
long_description=long_description,
long_description_content_type='text/markdown',
author='Flowable',
license='',
install_requires=['requests'],
install_requires=['requests>=2.27.0'],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'vcrpy'],
test_suite='tests',
Expand Down
2 changes: 1 addition & 1 deletion tests/test_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import time
from datetime import timedelta

from flowableexternalworker import ExternalWorkerClient, WorkerResultBuilder, ExternalWorkerAcquireJobResponse, CallbackHandlerType
from flowable.external_worker_client import ExternalWorkerClient, WorkerResultBuilder, ExternalWorkerAcquireJobResponse, CallbackHandlerType
from tests.basic_test import BasicTest, base_url, auth
from tests.bpmn_utils import start_process, executed_activity_ids, terminate_process, get_process_variable
from tests.cmmn_utils import start_case, get_case_variable
Expand Down
4 changes: 2 additions & 2 deletions tests/test_restclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from requests import Session
from requests.auth import HTTPBasicAuth

from flowableexternalworker import restclient
from flowableexternalworker.engine_rest_variable import EngineRestVariable
from flowable.external_worker_client import restclient
from flowable.external_worker_client.engine_rest_variable import EngineRestVariable
from tests.basic_test import base_url, auth, BasicTest
from tests.bpmn_utils import deploy_process, delete_deployment, start_process, terminate_process, get_process_definition_id, get_process_variable, \
executed_activity_ids
Expand Down

0 comments on commit c21a7b2

Please sign in to comment.