diff --git a/.github/workflows/build-httpctrl.yml b/.github/workflows/build-httpctrl.yml index 02addd6..0aec885 100755 --- a/.github/workflows/build-httpctrl.yml +++ b/.github/workflows/build-httpctrl.yml @@ -21,7 +21,8 @@ jobs: run: ci/github-ci.sh - name: Archive artifacts - uses: actions/upload-artifact@v2 + if: always() + uses: actions/upload-artifact@v4 with: name: SCT test reports path: | diff --git a/CHANGES b/CHANGES index 76f2b19..a139ea0 100755 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,20 @@ ------------------------------------------------------------------------ +CHANGE NOTES FOR 0.3.2 (RELEASED: Sep 11, 2025) + +------------------------------------------------------------------------ + +GENERAL CHANGES + +- Add `pyproject.toml` to support modern PEP 517/518 builds. + See: https://github.com/annoviko/robotframework-httpctrl/issues/44 + +- Removed `setup.py` - old-style installs may not work. + See: https://github.com/annoviko/robotframework-httpctrl/issues/44 + + +------------------------------------------------------------------------ + CHANGE NOTES FOR 0.3.1 (RELEASED: Dec 3, 2022) ------------------------------------------------------------------------ diff --git a/README.rst b/README.rst index 32865ff..746b30a 100755 --- a/README.rst +++ b/README.rst @@ -1,34 +1,14 @@ -|Build Status Linux| |PyPi| - HttpCtrl library for Robot Framework ==================================== -**RobotFramework-HttpCtrl** is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server (IPv4 and IPv6) services +**RobotFramework-HttpCtrl** is a library for Robot Framework that provides HTTP/HTTPS client and HTTP (IPv4 and IPv6) server services to make REST API testing easy. -**Author**: Andrei Novikov - **License**: The 3-Clause BSD License **Documentation**: https://annoviko.github.io/robotframework-httpctrl/ -Request Feature -=============== - -New features are implemented by request that can be created here using issues [`Press Me to Create a Feature Request`_]. Please, do not hesitate to create feature requests. - -.. _Press Me to Create a Feature Request: https://github.com/annoviko/robotframework-httpctrl/issues/new?assignees=&labels=&template=feature_request.md&title= - - -Bug Reporting -============= - -Please, do not hesitate to report about bugs using issues here [`Press Me to Report a Bug`_]. - -.. _Press Me to Report a Bug: https://github.com/annoviko/robotframework-httpctrl/issues/new?assignees=&labels=bug&template=bug_report.md&title= - - Dependencies ============ @@ -73,7 +53,6 @@ Send GET request to obtain origin IP address and check that is not empty: *** Settings *** - Library String Library HttpCtrl.Client Library HttpCtrl.Json @@ -94,67 +73,6 @@ Send GET request to obtain origin IP address and check that is not empty: Should Not Be Empty ${origin} -Send POST request and extract required information from response: - -.. code:: robotframework - - *** Settings *** - - Library String - Library HttpCtrl.Client - Library HttpCtrl.Json - - *** Test Cases *** - - Send POST Request - Initialize Client www.httpbin.org - - ${body}= Set Variable { "message": "Hello World!" } - Send HTTP Request POST /post ${body} - - ${response status}= Get Response Status - ${response body}= Get Response Body - ${response body}= Decode Bytes To String ${response body} UTF-8 - - ${expected status}= Convert To Integer 200 - Should Be Equal ${response status} ${expected status} - - ${message}= Get Json Value From String ${response body} data - Should Be Equal ${message} ${body} - - -Send PATCH request using HTTPS protocol: - -.. code:: robotframework - - *** Settings *** - - Library String - Library HttpCtrl.Client - Library HttpCtrl.Json - - *** Test Cases *** - - Send HTTPS PATCH Request - Initialize Client www.httpbin.org - - ${body}= Set Variable { "volume": 77, "mute": false } - Send HTTPS Request PATCH /patch ${body} - - ${response status}= Get Response Status - ${response body}= Get Response Body - ${response body}= Decode Bytes To String ${response body} UTF-8 - - ${expected status}= Convert To Integer 200 - Should Be Equal ${response status} ${expected status} - - ${volume}= Get Json Value From String ${response body} json/volume - Should Be Equal ${volume} ${77} - - ${mute}= Get Json Value From String ${response body} json/mute - Should Be Equal ${mute} ${False} - - In this example HTTP client sends POST request to HTTP server. HTTP server receives it and checks incoming request for correctness. @@ -194,10 +112,4 @@ request for correctness. Start Server 127.0.0.1 8000 Terminate HTTP Server - Stop Server - - -.. |Build Status Linux| image:: https://github.com/annoviko/robotframework-httpctrl/actions/workflows/build-httpctrl.yml/badge.svg - :target: https://github.com/annoviko/robotframework-httpctrl/actions -.. |PyPi| image:: https://badge.fury.io/py/robotframework-httpctrl.svg - :target: https://badge.fury.io/py/robotframework-httpctrl \ No newline at end of file + Stop Server \ No newline at end of file diff --git a/VERSION b/VERSION index 9e11b32..d15723f 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1 +0.3.2 diff --git a/ci/github-ci-release.sh b/ci/github-ci-release.sh index 1140393..23afd9c 100755 --- a/ci/github-ci-release.sh +++ b/ci/github-ci-release.sh @@ -76,7 +76,7 @@ pip3 install robotframework docutils pygments twine # Release to PyPi -python3 setup.py sdist +python3 -m build twine upload dist/* -r pypi if [ $? -ne 0 ]; then echo "[ERROR] Impossible to release the library to PyPi (reason: uploading to pypi failed)." diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..88a75f1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,45 @@ +[project] +name = "robotframework-httpctrl" +dynamic = ["version"] +authors = [ + { name = "Andrei Novikov", email = "spb.andr@yandex.ru" }, +] +maintainers = [ + { name = "Andrei Novikov", email = "spb.andr@yandex.ru" }, +] +description = "robotframework-httpctrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services." +readme = "PKG-INFO.rst" +license = "BSD-3-Clause" +license-files = ["LICENSE"] +requires-python = ">= 3.8" +dependencies = [ + "robotframework", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Telecommunications Industry", + "Natural Language :: English", + "Topic :: Software Development :: Build Tools", + "Programming Language :: Python :: 3 :: Only", + "Topic :: Education", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: HTTP Servers", + "Topic :: Software Development :: Testing", + "Framework :: Robot Framework :: Library", +] +keywords = ["httpctrl", "http", "https", "robotframework", "client", "server", "json", "test", "testing"] + +[project.urls] +homepage = "https://annoviko.github.io/robotframework-httpctrl/" +source = "https://github.com/annoviko/robotframework-httpctrl" +documentation = "https://annoviko.github.io/robotframework-httpctrl/" +tracker = "https://github.com/annoviko/robotframework-httpctrl/issues" +changelog = "https://github.com/annoviko/robotframework-httpctrl/blob/master/CHANGES" + +[tool.setuptools] +package-dir = {"" = "src"} +packages = ["HttpCtrl", "HttpCtrl.utils"] + +[tool.setuptools.dynamic] +version = { file = "VERSION" } \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100755 index a8973d7..0000000 --- a/setup.py +++ /dev/null @@ -1,72 +0,0 @@ -""" - -HttpCtrl library provides HTTP/HTTPS client and server API to Robot Framework to make REST API testing easy. - -Authors: Andrei Novikov -Date: 2018-2022 -Copyright: The 3-Clause BSD License - -""" - -import os - -from setuptools import setup - - -def load_readme(): - readme_file = 'PKG-INFO.rst' - if os.path.isfile(readme_file): - with open(readme_file) as file_descr: - return file_descr.read() - - return "robotframework-httpctrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services." - - -def load_version(): - version_file = 'VERSION' - if os.path.isfile(version_file): - with open(version_file) as file_descr: - return file_descr.read() - - return 'unknown' - - -setup( - name='robotframework-httpctrl', - packages=['HttpCtrl', 'HttpCtrl.utils'], - version=load_version(), - description='robotframework-httpctrl is a library for Robot Framework that provides HTTP/HTTPS client and HTTP server services', - platforms='any', - long_description=load_readme(), - url='https://github.com/annoviko/robotframework-httpctrl', - project_urls={ - 'Homepage': 'https://annoviko.github.io/robotframework-httpctrl/', - 'Repository': 'https://github.com/annoviko/robotframework-httpctrl', - 'Documentation': 'https://annoviko.github.io/robotframework-httpctrl/', - 'Bug Tracker': 'https://github.com/annoviko/robotframework-httpctrl/issues' - }, - license='BSD-3-Clause', - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: Telecommunications Industry', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Programming Language :: Python :: 3 :: Only', - 'Topic :: Education', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: HTTP Servers', - 'Topic :: Software Development :: Testing', - 'Framework :: Robot Framework :: Library' - ], - keywords='httpctrl http https robotframework client server json test testing', - author='Andrei Novikov', - author_email='spb.andr@yandex.ru', - - python_requires='>=3.8', - install_requires=['robotframework'], - - package_dir={'': 'src'}, - data_files=[('', ['LICENSE', 'CHANGES', 'README.rst', 'PKG-INFO.rst', 'VERSION'])] -) -