Skip to content

Commit 4924c7d

Browse files
abhisitAbhisit Sangjan
authored and
Abhisit Sangjan
committed
Initial source code and tagged v1.0.0 to be released it
0 parents  commit 4924c7d

16 files changed

+1322
-0
lines changed

.github/workflows/python-package.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
python-version: ["3.10", "3.11"]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v3
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Python dependencies
29+
run: |
30+
python -m pip install --upgrade pip
31+
python -m pip install -r requirements.txt
32+
- name: Lint with Ruff
33+
run: |
34+
python -m pip install ruff
35+
ruff check --output-format=github .
36+
continue-on-error: false
37+
- name: Build Dist Wheels
38+
run: |
39+
mkdir -p ${{ github.workspace }}/artifacts
40+
python setup.py bdist_wheel
41+
mv dist/* ${{ github.workspace }}/artifacts/
42+
- name: Archive Build Artifacts
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: PlainTextTerminal-${{ matrix.python-version }}-${{ matrix.os }}
46+
path: ${{ github.workspace }}/artifacts/*.whl
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python Release
5+
6+
on:
7+
push:
8+
tags:
9+
- "v*"
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ${{ matrix.os }}
15+
permissions:
16+
contents: write
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-22.04]
21+
python-version: ["3.10"]
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
- name: Install Python dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install -r requirements.txt
33+
- name: Lint with Ruff
34+
run: |
35+
python -m pip install ruff
36+
ruff check --output-format=github .
37+
continue-on-error: false
38+
- name: Build Dist Wheel
39+
run: |
40+
mkdir -p ${{ github.workspace }}/artifact
41+
python setup.py bdist_wheel
42+
mv dist/* ${{ github.workspace }}/artifact/
43+
- name: Public Wheel
44+
uses: softprops/action-gh-release@v2
45+
with:
46+
draft: true
47+
prerelease: false
48+
files: "${{ github.workspace }}/artifact/*.whl"
49+
fail_on_unmatched_files: true

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Python
2+
.venv
3+
build/
4+
dist/
5+
**/**/*.egg-info
6+
**/**/*.py[cod]
7+
**/**/__pycache__
8+
9+
# PyCharm
10+
.idea

.vscode/extensions.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": [
6+
// Basic mostly common configuration
7+
"editorconfig.editorconfig",
8+
// PyCharm theme
9+
"danields761.dracula-theme-from-intellij-pythoned",
10+
// Folder compare
11+
"moshfeu.compare-folders",
12+
// Python Language Lerver
13+
"ms-python.vscode-pylance",
14+
// SSH handy
15+
"ms-vscode-remote.remote-ssh",
16+
// YAML syntax highlight
17+
"redhat.vscode-yaml",
18+
// Robot Framework Language Server
19+
"d-biehl.robotcode",
20+
// AI assistant
21+
"visualstudioexptteam.vscodeintellicode",
22+
// Git commit view
23+
"eamodio.gitlens",
24+
// Python formatter
25+
"ms-python.black-formatter"
26+
],
27+
// List of extensions which should not be recommended for users of this workspace.
28+
"unwantedRecommendations": [
29+
"tomiturtiainen.rf-intellisense",
30+
"snooz82.rf-intellisense"
31+
]
32+
}

.vscode/settings.json

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"python.languageServer": "Pylance",
3+
"[python]": {
4+
"editor.defaultFormatter": "ms-python.black-formatter",
5+
"editor.formatOnType": false,
6+
"editor.formatOnSave": true,
7+
"editor.formatOnSaveMode": "file",
8+
"editor.codeActionsOnSave": {
9+
"source.organizeImports": "explicit"
10+
}
11+
},
12+
"isort.args": [
13+
"--settings-file=${workspaceFolder}/.isort.cfg"
14+
],
15+
"black-formatter.args": [
16+
"--include=${workspaceFolder}/pyproject.toml"
17+
],
18+
"ruff.lint.args": [
19+
"--config=${workspaceFolder}/pyproject.toml"
20+
],
21+
"yapf.args": [
22+
"--style='{based_on_style: pep8, column_limit: 98}'"
23+
],
24+
"pylint.args": [
25+
"--rcfile=${workspaceFolder}/.pylintrc"
26+
],
27+
"flake8.args": [
28+
"--config=${workspaceFolder}/.flake8"
29+
]
30+
}

0001-Tag-v1.0.1-to-release-it.patch

+179
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
From faecb7aa77c9078f504935c75ea07ead6ae26768 Mon Sep 17 00:00:00 2001
2+
From: Abhisit Sangjan <3991182+abhisit@users.noreply.github.com>
3+
Date: Fri, 12 Jul 2024 08:17:59 +0700
4+
Subject: [PATCH] Tag v1.0.1 to release it
5+
6+
- ROBOT_AUTO_KEYWORDS = False
7+
- Be fail if Ruff has reported error
8+
---
9+
.github/workflows/python-package.yml | 46 +++++++++++++++++
10+
.../python-release-by-tag-creation.yml | 49 +++++++++++++++++++
11+
pyproject.toml | 2 +-
12+
setup.py | 1 -
13+
src/PlainTextTerminal/PlainTextTerminal.py | 1 +
14+
src/PlainTextTerminal/__init__.py | 4 +-
15+
6 files changed, 100 insertions(+), 3 deletions(-)
16+
create mode 100644 .github/workflows/python-package.yml
17+
create mode 100644 .github/workflows/python-release-by-tag-creation.yml
18+
19+
diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
20+
new file mode 100644
21+
index 0000000..afb627b
22+
--- /dev/null
23+
+++ b/.github/workflows/python-package.yml
24+
@@ -0,0 +1,46 @@
25+
+# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
26+
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
27+
+
28+
+name: Python package
29+
+
30+
+on:
31+
+ push:
32+
+ branches: [ "main" ]
33+
+ pull_request:
34+
+ branches: [ "main" ]
35+
+
36+
+jobs:
37+
+ build:
38+
+
39+
+ runs-on: ${{ matrix.os }}
40+
+ strategy:
41+
+ fail-fast: false
42+
+ matrix:
43+
+ os: [ubuntu-latest, windows-latest, macos-latest]
44+
+ python-version: ["3.10", "3.11"]
45+
+
46+
+ steps:
47+
+ - uses: actions/checkout@v4
48+
+ - name: Set up Python ${{ matrix.python-version }}
49+
+ uses: actions/setup-python@v3
50+
+ with:
51+
+ python-version: ${{ matrix.python-version }}
52+
+ - name: Install Python dependencies
53+
+ run: |
54+
+ python -m pip install --upgrade pip
55+
+ python -m pip install -r requirements.txt
56+
+ - name: Lint with Ruff
57+
+ run: |
58+
+ python -m pip install ruff
59+
+ ruff check --output-format=github .
60+
+ continue-on-error: false
61+
+ - name: Build Dist Wheels
62+
+ run: |
63+
+ mkdir -p ${{ github.workspace }}/artifacts
64+
+ python setup.py bdist_wheel
65+
+ mv dist/* ${{ github.workspace }}/artifacts/
66+
+ - name: Archive Build Artifacts
67+
+ uses: actions/upload-artifact@v4
68+
+ with:
69+
+ name: PlainTextTerminal-${{ matrix.python-version }}-${{ matrix.os }}
70+
+ path: ${{ github.workspace }}/artifacts/*.whl
71+
\ No newline at end of file
72+
diff --git a/.github/workflows/python-release-by-tag-creation.yml b/.github/workflows/python-release-by-tag-creation.yml
73+
new file mode 100644
74+
index 0000000..387eb21
75+
--- /dev/null
76+
+++ b/.github/workflows/python-release-by-tag-creation.yml
77+
@@ -0,0 +1,49 @@
78+
+# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
79+
+# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
80+
+
81+
+name: Python Release
82+
+
83+
+on:
84+
+ push:
85+
+ tags:
86+
+ - "v*"
87+
+
88+
+jobs:
89+
+ build:
90+
+
91+
+ runs-on: ${{ matrix.os }}
92+
+ permissions:
93+
+ contents: write
94+
+ strategy:
95+
+ fail-fast: false
96+
+ matrix:
97+
+ os: [ubuntu-22.04]
98+
+ python-version: ["3.10"]
99+
+
100+
+ steps:
101+
+ - uses: actions/checkout@v4
102+
+ - name: Set up Python ${{ matrix.python-version }}
103+
+ uses: actions/setup-python@v3
104+
+ with:
105+
+ python-version: ${{ matrix.python-version }}
106+
+ - name: Install Python dependencies
107+
+ run: |
108+
+ python -m pip install --upgrade pip
109+
+ python -m pip install -r requirements.txt
110+
+ - name: Lint with Ruff
111+
+ run: |
112+
+ python -m pip install ruff
113+
+ ruff check --output-format=github .
114+
+ continue-on-error: false
115+
+ - name: Build Dist Wheel
116+
+ run: |
117+
+ mkdir -p ${{ github.workspace }}/artifact
118+
+ python setup.py bdist_wheel
119+
+ mv dist/* ${{ github.workspace }}/artifact/
120+
+ - name: Public Wheel
121+
+ uses: softprops/action-gh-release@v2
122+
+ with:
123+
+ draft: true
124+
+ prerelease: false
125+
+ files: "${{ github.workspace }}/artifact/*.whl"
126+
+ fail_on_unmatched_files: true
127+
\ No newline at end of file
128+
diff --git a/pyproject.toml b/pyproject.toml
129+
index c34ff22..a7bd120 100644
130+
--- a/pyproject.toml
131+
+++ b/pyproject.toml
132+
@@ -1,5 +1,5 @@
133+
[build-system]
134+
-requires = ["robotframework>=7.0.1", "robotframework-sshlibrary>=3.8.0", "robotframework-tidy>=4.13.0"]
135+
+requires = ["robotframework>=7.0.1", "robotframework-sshlibrary>=3.8.0"]
136+
build-backend = "flit_core.buildapi"
137+
138+
[tool.flit.metadata]
139+
diff --git a/setup.py b/setup.py
140+
index 39f49f2..4c4577b 100644
141+
--- a/setup.py
142+
+++ b/setup.py
143+
@@ -78,7 +78,6 @@ setup(
144+
install_requires=[
145+
"robotframework>=7.0.1",
146+
"robotframework-sshlibrary>=3.8.0",
147+
- "robotframework-tidy>=4.13.0",
148+
],
149+
keywords="robotframework terminal testing telnet ssh",
150+
python_requires=">=3.10.12",
151+
diff --git a/src/PlainTextTerminal/PlainTextTerminal.py b/src/PlainTextTerminal/PlainTextTerminal.py
152+
index f046088..05e9076 100644
153+
--- a/src/PlainTextTerminal/PlainTextTerminal.py
154+
+++ b/src/PlainTextTerminal/PlainTextTerminal.py
155+
@@ -49,6 +49,7 @@ class PlainTextTerminal:
156+
157+
ROBOT_LIBRARY_SCOPE = "SUITE"
158+
ROBOT_LIBRARY_VERSION = get_version()
159+
+ ROBOT_AUTO_KEYWORDS = False
160+
161+
_terminal = None
162+
163+
diff --git a/src/PlainTextTerminal/__init__.py b/src/PlainTextTerminal/__init__.py
164+
index cf5faa3..89b0c4b 100644
165+
--- a/src/PlainTextTerminal/__init__.py
166+
+++ b/src/PlainTextTerminal/__init__.py
167+
@@ -17,6 +17,8 @@
168+
169+
from .PlainTextTerminal import PlainTextTerminal
170+
171+
-__version__ = "1.0.0"
172+
+__version__ = "1.0.1"
173+
174+
VERSION = __version__
175+
+
176+
+__all__ = ["PlainTextTerminal"]
177+
--
178+
2.45.2
179+

0 commit comments

Comments
 (0)