From 8dd8e2ba6eef8fa09ed71cfbc617d4ad68331acf Mon Sep 17 00:00:00 2001 From: Matthew Keeler Date: Tue, 2 Jan 2024 12:49:31 -0500 Subject: [PATCH] build: Convert to poetry --- .github/actions/build-docs/action.yml | 9 ++ .github/actions/build/action.yml | 9 ++ .github/actions/publish/action.yml | 15 --- .github/workflows/ci.yml | 64 +++++-------- .github/workflows/manual-publish.yml | 13 ++- .github/workflows/release-please.yml | 19 +++- .gitignore | 4 + .readthedocs.yml | 11 ++- CONTRIBUTING.md | 17 ++-- MANIFEST.in | 7 -- Makefile | 111 ++++++++++++++++------ consul-requirements.txt | 1 - contract-tests/requirements.txt | 2 - docs/Makefile | 19 ---- docs/requirements.txt | 11 --- dynamodb-requirements.txt | 1 - mypy.ini | 2 - pyproject.toml | 99 +++++++++++++++++++ pytest.ini | 2 - redis-requirements.txt | 1 - requirements.txt | 5 - setup.py | 82 ---------------- sse-contract-tests/Makefile | 27 ------ sse-contract-tests/README.md | 2 +- sse-contract-tests/requirements.txt | 2 - test-filesource-optional-requirements.txt | 2 - test-packaging/test-packaging.sh | 15 --- test-packaging/test.py | 5 - test-requirements.txt | 9 -- 29 files changed, 272 insertions(+), 294 deletions(-) create mode 100644 .github/actions/build-docs/action.yml create mode 100644 .github/actions/build/action.yml delete mode 100644 MANIFEST.in delete mode 100644 consul-requirements.txt delete mode 100644 contract-tests/requirements.txt delete mode 100644 docs/Makefile delete mode 100644 docs/requirements.txt delete mode 100644 dynamodb-requirements.txt delete mode 100644 mypy.ini create mode 100644 pyproject.toml delete mode 100644 pytest.ini delete mode 100644 redis-requirements.txt delete mode 100644 requirements.txt delete mode 100644 setup.py delete mode 100644 sse-contract-tests/Makefile delete mode 100644 sse-contract-tests/requirements.txt delete mode 100644 test-filesource-optional-requirements.txt delete mode 100755 test-packaging/test-packaging.sh delete mode 100644 test-packaging/test.py delete mode 100644 test-requirements.txt diff --git a/.github/actions/build-docs/action.yml b/.github/actions/build-docs/action.yml new file mode 100644 index 00000000..84e6a1b2 --- /dev/null +++ b/.github/actions/build-docs/action.yml @@ -0,0 +1,9 @@ +name: Build Documentation +description: 'Build Documentation.' + +runs: + using: composite + steps: + - name: Build Documentation + shell: bash + run: make docs diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 00000000..5cf127c1 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,9 @@ +name: Build distribution files +description: 'Build distribution files' + +runs: + using: composite + steps: + - name: Build distribution files + shell: bash + run: poetry build diff --git a/.github/actions/publish/action.yml b/.github/actions/publish/action.yml index 01d3a6e9..60910ad2 100644 --- a/.github/actions/publish/action.yml +++ b/.github/actions/publish/action.yml @@ -11,21 +11,6 @@ inputs: runs: using: composite steps: - - name: Set up Python 3.11 - uses: actions/setup-python@v4 - with: - python-version: 3.11 - - - name: Install dependencies - shell: bash - run: | - pip install -r requirements.txt - pip install wheel - - - name: Building publishable packages - shell: bash - run: python setup.py sdist bdist_wheel - - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 if: ${{ inputs.dry_run == 'false' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b12e120..6bbaa677 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,54 +39,45 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install requirements - run: | - pipx install virtualenv - pip install -r test-requirements.txt - pip install -r test-filesource-optional-requirements.txt - pip install -r consul-requirements.txt - python setup.py install - pip freeze + - name: Install poetry + run: pipx install poetry - - name: Run tests - run: pytest -s testing -W error::SyntaxWarning + - uses: ./.github/actions/build + - uses: ./.github/actions/build-docs - - name: Test packaging - run: | - sudo rm -rf dist *.egg-info - ./test-packaging/test-packaging.sh + - name: Run tests + run: make test - name: Verify typehints run: make lint - - name: Verify docs can be successfully built - run: make docs + # + # SSE contract tests + # - - name: build SSE contract test service + - name: install sse contract test dependencies if: ${{ matrix.python-version != 3.7 }} - run: | - cd sse-contract-tests - make build-test-service + run: make install-sse-contract-tests-deps - - name: start SSE contract test service + - name: start sse contract test service if: ${{ matrix.python-version != 3.7 }} - run: | - cd sse-contract-tests - make start-test-service & + run: make start-sse-contract-test-service-bg - - name: run SSE contract tests + - name: run sse contract tests if: ${{ matrix.python-version != 3.7 }} - run: | - cd sse-contract-tests - make run-contract-tests + run: make run-sse-contract-tests + + # + # SDK contract tests + # - - name: Build contract tests + - name: install contract test dependencies if: ${{ matrix.python-version != 3.7 }} - run: make build-contract-tests + run: make install-contract-tests-deps - - name: Start contract test service + - name: start contract test service if: ${{ matrix.python-version != 3.7 }} - run: make start-contract-test-service & + run: make start-contract-test-service-bg - name: run contract tests if: ${{ matrix.python-version != 3.7 }} @@ -143,11 +134,8 @@ jobs: - name: Install requirements run: | - pip install -r test-requirements.txt - pip install -r test-filesource-optional-requirements.txt - pip install -r consul-requirements.txt - python setup.py install - pip freeze + pipx install poetry + poetry install --all-extras - name: Run tests - run: pytest -s testing -W error::SyntaxWarning + run: make test diff --git a/.github/workflows/manual-publish.yml b/.github/workflows/manual-publish.yml index edd263ea..c38f49a5 100644 --- a/.github/workflows/manual-publish.yml +++ b/.github/workflows/manual-publish.yml @@ -17,15 +17,22 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - name: Install poetry + run: pipx install poetry + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 name: 'Get PyPI token' with: aws_assume_role: ${{ vars.AWS_ROLE_ARN }} ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN' - - id: publish - name: Publish Package - uses: ./.github/actions/publish + - uses: ./.github/actions/build + + - uses: ./.github/actions/publish with: token: ${{env.PYPI_AUTH_TOKEN}} dry_run: ${{ inputs.dry_run }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index a4ec47bb..e5d14e63 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -24,6 +24,15 @@ jobs: with: fetch-depth: 0 # If you only need the current version keep this. + - uses: actions/setup-python@v4 + if: ${{ steps.release.outputs.releases_created }} + with: + python-version: 3.7 + + - name: Install poetry + if: ${{ steps.release.outputs.releases_created }} + run: pipx install poetry + - uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0 if: ${{ steps.release.outputs.releases_created }} name: 'Get PyPI token' @@ -31,9 +40,13 @@ jobs: aws_assume_role: ${{ vars.AWS_ROLE_ARN }} ssm_parameter_pairs: '/production/common/releasing/pypi/token = PYPI_AUTH_TOKEN' - - id: publish - name: Publish Package - uses: ./.github/actions/publish + - uses: ./.github/actions/build + if: ${{ steps.release.outputs.releases_created }} + + - uses: ./.github/actions/build-docs + if: ${{ steps.release.outputs.releases_created }} + + - uses: ./.github/actions/publish if: ${{ steps.release.outputs.releases_created }} with: token: ${{env.PYPI_AUTH_TOKEN}} diff --git a/.gitignore b/.gitignore index 291d3e29..7b091b3c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ .Python env/ build/ +!.github/actions/build/ develop-eggs/ dist/ downloads/ @@ -70,3 +71,6 @@ test-packaging-venv .vscode/ .python-version + +# Poetry +poetry.lock diff --git a/.readthedocs.yml b/.readthedocs.yml index 74aa8c2d..2a4fc81d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,11 +4,12 @@ build: os: "ubuntu-22.04" tools: python: "3.7" - -python: - install: - - requirements: docs/requirements.txt - - requirements: requirements.txt + jobs: + post_create_environment: + - pip install poetry + - poetry config virtualenvs.create false + post_install: + - poetry install --with docs sphinx: builder: html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b956b9e..9aebeeec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,22 +14,23 @@ We encourage pull requests and other contributions from the community. Before su ### Setup -It's advisable to use [`virtualenv`](https://virtualenv.pypa.io/) to create a development environment within the project directory: +This project is built using [poetry](https://python-poetry.org/). To learn more about the basics of working with this tool, read [Poetry's basic usage guide](https://python-poetry.org/docs/basic-usage/). + +To begin development, active the poetry shell and ensure your dependencies are installed. ``` -mkvirtualenv python-server-sdk -source ~/.virtualenvs/python-server-sdk/bin/activate +poetry shell +poetry install ``` -To install the runtime and test requirements: +This library defines several extra dependencies to optionally enhance the SDK's capabilities. Use the following commands to install one or more of the available extras. ``` -pip install -r requirements.txt -pip install -r test-requirements.txt +poetry install --extras "redis consul dynamodb test-filesource" +poetry install -E redis -E consul -E dynamodb -E test-filesource +poetry install --all-extras ``` -The additional requirements files `consul-requirements.txt`, `dynamodb-requirements.txt`, `redis-requirements.txt`, and `test-filesource-optional-requirements.txt` can also be installed if you need to test the corresponding features. - ### Testing To run all unit tests except for the database integrations: diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index f376dd16..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include requirements.txt -include README.txt -include test-requirements.txt -include consul-requirements.txt -include dynamodb-requirements.txt -include redis-requirements.txt -include ldclient/py.typed diff --git a/Makefile b/Makefile index e007f6d9..6a42c00a 100644 --- a/Makefile +++ b/Makefile @@ -1,45 +1,100 @@ - PYTEST_FLAGS=-W error::SyntaxWarning -test: - LD_SKIP_DATABASE_TESTS=1 pytest $(PYTEST_FLAGS) - -test-all: - pytest $(PYTEST_FLAGS) - -lint: - mypy --install-types --non-interactive --config-file mypy.ini ldclient testing - -docs: - cd docs && make html - -.PHONY: test test-all lint docs - - TEMP_TEST_OUTPUT=/tmp/contract-test-service.log -# TEST_HARNESS_PARAMS can be set to add -skip parameters for any contract tests that cannot yet pass -# TEST_HARNESS_PARAMS := $(TEST_HARNESS_PARAMS) \ - - +SPHINXOPTS = -W --keep-going +SPHINXBUILD = sphinx-build +SPHINXPROJ = launchdarkly-server-sdk +SOURCEDIR = docs +BUILDDIR = $(SOURCEDIR)/build # port 8000 and 9000 is already used in the CI environment because we're # running a DynamoDB container and an SSE contract test +SSE_PORT=9000 PORT=10000 -build-contract-tests: - @cd contract-tests && pip install -r requirements.txt - +.PHONY: help +help: #! Show this help message + @echo 'Usage: make [target] ... ' + @echo '' + @echo 'Targets:' + @grep -h -F '#!' $(MAKEFILE_LIST) | grep -v grep | sed 's/:.*#!/:/' | column -t -s":" + +.PHONY: install +install: + @poetry install --all-extras + +# +# Quality control checks +# + +.PHONY: test +test: #! Run unit tests +test: install + @poetry run pytest $(PYTEST_FLAGS) + +.PHONY: lint +lint: #! Run type analysis and linting checks +lint: install + @poetry run mypy ldclient testing + +# +# Documentation generation +# + +.PHONY: docs +docs: #! Generate sphinx-based documentation + @poetry install --with docs + @cd docs + @poetry run $(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +# +# Contract test service commands +# + +.PHONY: install-contract-tests-deps +install-contract-tests-deps: + poetry install --with contract-tests + +.PHONY: start-contract-test-service start-contract-test-service: - @cd contract-tests && python service.py $(PORT) + @cd contract-tests && poetry run python service.py $(PORT) +.PHONY: start-contract-test-service-bg start-contract-test-service-bg: @echo "Test service output will be captured in $(TEMP_TEST_OUTPUT)" @make start-contract-test-service >$(TEMP_TEST_OUTPUT) 2>&1 & +.PHONY: run-contract-tests run-contract-tests: - curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v2/downloader/run.sh \ - | VERSION=v2 PARAMS="-url http://localhost:$(PORT) -debug -stop-service-at-end $(TEST_HARNESS_PARAMS)" sh + @curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v2/downloader/run.sh \ + | VERSION=v2 PARAMS="-url http://localhost:$(PORT) -debug -stop-service-at-end" sh + +.PHONY: contract-tests +contract-tests: #! Run the contract test harness +contract-tests: install-contract-tests-deps start-contract-test-service-bg run-contract-tests + +# +# SSE contract test service commands +# + +.PHONY: install-sse-contract-tests-deps +install-sse-contract-tests-deps: + poetry install --with contract-tests + +.PHONY: start-sse-contract-test-service +start-sse-contract-test-service: + @cd sse-contract-tests && poetry run python service.py $(SSE_PORT) + +.PHONY: start-sse-contract-test-service-bg +start-sse-contract-test-service-bg: + @echo "Test service output will be captured in $(TEMP_TEST_OUTPUT)" + @make start-sse-contract-test-service >$(TEMP_TEST_OUTPUT) 2>&1 & -contract-tests: build-contract-tests start-contract-test-service-bg run-contract-tests +.PHONY: run-sse-contract-tests +run-sse-contract-tests: + @curl -s https://raw.githubusercontent.com/launchdarkly/sse-contract-tests/v2.0.0/downloader/run.sh \ + | VERSION=v1 PARAMS="-url http://localhost:$(SSE_PORT) -debug -stop-service-at-end -skip reconnection" sh -.PHONY: build-contract-tests start-contract-test-service run-contract-tests contract-tests +.PHONY: sse-contract-tests +sse-contract-tests: #! Run the sse contract test harness +sse-contract-tests: install-sse-contract-tests-deps start-sse-contract-test-service-bg run-sse-contract-tests diff --git a/consul-requirements.txt b/consul-requirements.txt deleted file mode 100644 index 637f7fe1..00000000 --- a/consul-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -python-consul>=1.0.1 diff --git a/contract-tests/requirements.txt b/contract-tests/requirements.txt deleted file mode 100644 index 46a07968..00000000 --- a/contract-tests/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Flask==2.3.2 -urllib3>=1.22.0,<3 diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index 91f52ddc..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -.PHONY: help install html - -SPHINXOPTS = -W --keep-going -SPHINXBUILD = sphinx-build -SPHINXPROJ = launchdarkly-server-sdk -SOURCEDIR = . -BUILDDIR = build - -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -install: - pip3 install -r requirements.txt - -html: install - @$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 37aab242..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -sphinx -sphinx_rtd_theme -sphinx-autodoc-typehints - -backoff>=1.4.3 -certifi>=2018.4.16 -expiringdict>=1.1.4 -pyRFC3339>=1.0 -jsonpickle==0.9.3 -semver>=2.7.9 -urllib3>=1.22.0,<3 diff --git a/dynamodb-requirements.txt b/dynamodb-requirements.txt deleted file mode 100644 index b72b66b6..00000000 --- a/dynamodb-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -boto3>=1.9.71 diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index e886c085..00000000 --- a/mypy.ini +++ /dev/null @@ -1,2 +0,0 @@ -[mypy] -ignore_missing_imports = true \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..4eb1f277 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,99 @@ +[tool.poetry] +name = "launchdarkly-server-sdk" +version = "8.2.1" +description = "LaunchDarkly SDK for Python" +authors = ["LaunchDarkly "] +license = "Apache-2.0" +readme = "README.md" +homepage = "https://docs.launchdarkly.com/sdk/server-side/python" +repository = "https://github.com/launchdarkly/python-server-sdk" +documentation = "https://launchdarkly-python-sdk.readthedocs.io/en/latest/" +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", +] +packages = [ + { include = "ldclient" }, + { include = "testing" }, +] + +[tool.poetry.dependencies] +python = ">=3.7" +certifi = ">=2018.4.16" +expiringdict = ">=1.1.4" +pyRFC3339 = ">=1.0" +semver = ">=2.10.2" +urllib3 = ">=1.22.0,<3" + +redis = { version = ">=2.10.5", optional = true } +python-consul = { version = ">=1.0.1", optional = true } +boto3 = { version = ">=1.9.71", optional = true } +pyyaml = { version = ">=3.0,<5.2", optional = true } +watchdog = { version = ">=0.9,<1.0,!=0.10.5", optional = true } + +[tool.poetry.extras] +redis = ["redis"] +consul = ["python-consul"] +dynamodb = ["boto3"] +test-filesource = ["pyyaml", "watchdog"] + + +[tool.poetry.group.dev.dependencies] +mock = ">=2.0.0" +pytest = ">=2.8" +redis = ">=2.10.5,<3.0.0" +boto3 = ">=1.9.71,<2.0.0" +coverage = ">=4.4" +jsonpickle = ">1.4.1" +pytest-cov = ">=2.4.0" +pytest-mypy = "==0.8.1" +mypy = "==0.910" + + +[tool.poetry.group.contract-tests] +optional = true + +[tool.poetry.group.contract-tests.dependencies] +Flask = "2.2.5" +urllib3 = ">=1.22.0,<3" + + +[tool.poetry.group.docs] +optional = true + +[tool.poetry.group.docs.dependencies] +sphinx = "^1.3.0" +sphinx-autodoc-typehints = "^1.3.0" +sphinx-rtd-theme = "^1.3.0" +backoff = ">=1.4.3" +certifi = ">=2018.4.16" +expiringdict = ">=1.1.4" +pyrfc3339 = ">=1.0" +jsonpickle = ">1.4.1" +semver = ">=2.7.9" +urllib3 = ">=1.22.0" +jinja2 = "3.0.0" + +[tool.mypy] +python_version = "3.7" +ignore_missing_imports = true +install_types = true +non_interactive = true + + +[tool.pytest.ini_options] +addopts = ["-ra"] + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index fcada504..00000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -addopts = -ra \ No newline at end of file diff --git a/redis-requirements.txt b/redis-requirements.txt deleted file mode 100644 index e3fc618b..00000000 --- a/redis-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -redis>=2.10.5 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 796ed901..00000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -certifi>=2018.4.16 -expiringdict>=1.1.4 -pyRFC3339>=1.0 -semver>=2.10.2 -urllib3>=1.22.0,<3 diff --git a/setup.py b/setup.py deleted file mode 100644 index c96ef429..00000000 --- a/setup.py +++ /dev/null @@ -1,82 +0,0 @@ -# type: ignore -from setuptools import find_packages, setup, Command - -import sys -import uuid - -# Get VERSION constant from ldclient.version - we can't simply import that module because -# ldclient/__init__.py imports all kinds of stuff that requires dependencies we may not have -# loaded yet. Based on https://packaging.python.org/guides/single-sourcing-package-version/ -version_module_globals = {} -with open('./ldclient/version.py') as f: - exec(f.read(), version_module_globals) -ldclient_version = version_module_globals['VERSION'] - -def parse_requirements(filename): - """ load requirements from a pip requirements file """ - lineiter = (line.strip() for line in open(filename)) - return [line for line in lineiter if line and not line.startswith("#")] - -# parse_requirements() returns generator of pip.req.InstallRequirement objects -install_reqs = parse_requirements('requirements.txt') -test_reqs = parse_requirements('test-requirements.txt') -redis_reqs = parse_requirements('redis-requirements.txt') -consul_reqs = parse_requirements('consul-requirements.txt') -dynamodb_reqs = parse_requirements('dynamodb-requirements.txt') - -# reqs is a list of requirement -# e.g. ['django==1.5.1', 'mezzanine==1.4.6'] -reqs = [ir for ir in install_reqs] -testreqs = [ir for ir in test_reqs] -redisreqs = [ir for ir in redis_reqs] -consulreqs = [ir for ir in consul_reqs] -dynamodbreqs = [ir for ir in dynamodb_reqs] - - -class PyTest(Command): - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - import sys - import subprocess - errno = subprocess.call([sys.executable, 'runtests.py']) - raise SystemExit(errno) - -setup( - name='launchdarkly-server-sdk', - version=ldclient_version, - author='LaunchDarkly', - author_email='team@launchdarkly.com', - packages=find_packages(), - include_package_data=True, - url='https://github.com/launchdarkly/python-server-sdk', - description='LaunchDarkly SDK for Python', - long_description='LaunchDarkly SDK for Python', - install_requires=reqs, - classifiers=[ - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - ], - extras_require={ - "redis": redisreqs, - "consul": consulreqs, - "dynamodb": dynamodbreqs - }, - tests_require=testreqs, - cmdclass={'test': PyTest}, -) diff --git a/sse-contract-tests/Makefile b/sse-contract-tests/Makefile deleted file mode 100644 index 1d4da244..00000000 --- a/sse-contract-tests/Makefile +++ /dev/null @@ -1,27 +0,0 @@ - -TEMP_TEST_OUTPUT=/tmp/sse-contract-test-service.log - -# port 8000 is already used in the CI environment because we're running a DynamoDB container -PORT=9000 - -# we're skipping the "reconnection" test group because the simplified SSE client we're currently using -# does not do automatic retrying of connections - that is done at a higher level in the SDK -EXTRA_TEST_PARAMS=-skip reconnection - -build-test-service: - @pip install -r requirements.txt - -start-test-service: - @python service.py $(PORT) - -start-test-service-bg: - @echo "Test service output will be captured in $(TEMP_TEST_OUTPUT)" - @make start-test-service >$(TEMP_TEST_OUTPUT) 2>&1 & - -run-contract-tests: - @curl -s https://raw.githubusercontent.com/launchdarkly/sse-contract-tests/v2.0.0/downloader/run.sh \ - | VERSION=v1 PARAMS="-url http://localhost:$(PORT) -debug -stop-service-at-end $(EXTRA_TEST_PARAMS)" sh - -contract-tests: build-test-service start-test-service-bg run-contract-tests - -.PHONY: build-test-service start-test-service start-test-service-bg run-contract-tests contract-tests diff --git a/sse-contract-tests/README.md b/sse-contract-tests/README.md index f5892c91..44189b40 100644 --- a/sse-contract-tests/README.md +++ b/sse-contract-tests/README.md @@ -2,4 +2,4 @@ This directory contains an implementation of the cross-platform SSE testing protocol defined by https://github.com/launchdarkly/sse-contract-tests. See that project's `README` for details of this protocol, and the kinds of SSE client capabilities that are relevant to the contract tests. This code should not need to be updated unless the SSE client has added or removed such capabilities. -To run these tests locally, run `make contract-tests`. This downloads the correct version of the test harness tool automatically. +To run these tests locally, run `make sse-contract-tests`. This downloads the correct version of the test harness tool automatically. diff --git a/sse-contract-tests/requirements.txt b/sse-contract-tests/requirements.txt deleted file mode 100644 index 46a07968..00000000 --- a/sse-contract-tests/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Flask==2.3.2 -urllib3>=1.22.0,<3 diff --git a/test-filesource-optional-requirements.txt b/test-filesource-optional-requirements.txt deleted file mode 100644 index 38bdc65b..00000000 --- a/test-filesource-optional-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -pyyaml>=3.0,<5.2 -watchdog>=0.9,<1.0,!=0.10.5 diff --git a/test-packaging/test-packaging.sh b/test-packaging/test-packaging.sh deleted file mode 100755 index 50a40364..00000000 --- a/test-packaging/test-packaging.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -rm -rf dist -python setup.py sdist - -cd test-packaging -rm -rf env -virtualenv env -source env/bin/activate - -pip install ../dist/*.tar.gz - -python test.py diff --git a/test-packaging/test.py b/test-packaging/test.py deleted file mode 100644 index 62f8b636..00000000 --- a/test-packaging/test.py +++ /dev/null @@ -1,5 +0,0 @@ -import ldclient -import ldclient.integrations -import ldclient.interfaces - -print("Successfully installed and imported ldclient") diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 1051db57..00000000 --- a/test-requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -mock>=2.0.0 -pytest>=2.8 -redis>=2.10.5,<3.0.0 -boto3>=1.9.71,<2.0.0 -coverage>=4.4 -jsonpickle==0.9.3 -pytest-cov>=2.4.0 -pytest-mypy==0.8.1 -mypy==0.910