From e2b2302bf50bdc6951b2d5ee7c1285c57f53d136 Mon Sep 17 00:00:00 2001 From: Ajinkya Udgirkar Date: Fri, 21 Jul 2023 14:51:05 +0530 Subject: [PATCH] WIP: Test version fix --- .git_archival.txt | 4 ++ .gitattributes | 7 +++ .gitignore | 4 ++ .prettierignore | 3 + dist/.gitignore | 4 -- dist/python-ansible-compat.spec.in | 88 ------------------------------ pyproject.toml | 5 +- requirements.txt | 2 +- tox.ini | 5 +- 9 files changed, 26 insertions(+), 96 deletions(-) create mode 100644 .git_archival.txt create mode 100644 .gitattributes delete mode 100644 dist/.gitignore delete mode 100644 dist/python-ansible-compat.spec.in diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 00000000..3994ec0a --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true)$ +ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..2e464337 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +# Force LF line endings for text files +* text=auto eol=lf + +*.png binary + +# Needed for setuptools-scm-git-archive +.git_archival.txt export-subst diff --git a/.gitignore b/.gitignore index 2da4600c..a20c99cf 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ __pycache__/ .Python build/ develop-eggs/ +dist/ downloads/ eggs/ .eggs/ @@ -130,3 +131,6 @@ dmypy.json .test-results *.lcov ansible_collections + +# Generated by setuptools-scm +src/ansible_compat/_version.py diff --git a/.prettierignore b/.prettierignore index 5df71c0d..1ea88f55 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,4 @@ test/assets/ + +# Generated by setuptools-scm +src/ansible_compat/_version.py diff --git a/dist/.gitignore b/dist/.gitignore deleted file mode 100644 index cc7bbdd9..00000000 --- a/dist/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -SRPMS/ -*.tar.gz -*-buildrequires -ansible-compat-*/ diff --git a/dist/python-ansible-compat.spec.in b/dist/python-ansible-compat.spec.in deleted file mode 100644 index 22af67ab..00000000 --- a/dist/python-ansible-compat.spec.in +++ /dev/null @@ -1,88 +0,0 @@ -%global numcomm @numcomm@ -%global alphatag @alphatag@ -%global dirty @dirty@ - -%global srcname ansible-compat -%global pkgname python-ansible-compat - -%bcond_without tests - -Name: python-ansible-compat -Version: VERSION_PLACEHOLDER -Release: 1%{?dist} -Summary: Ansible python helper functions - -License: MIT -URL: https://github.com/ansible/ansible-compat -Source0: %{pypi_source} -BuildArch: noarch - -BuildRequires: pyproject-rpm-macros -BuildRequires: ansible-core - -%if %{with tests} -BuildRequires: python3-pytest -BuildRequires: python3-pytest-mock -%endif - -%global common_description %{expand: -A python package containing functions that help interacting with -various versions of Ansible} - -%description %{common_description} - -%package -n python-%{srcname}-doc -Summary: %summary - -%description -n python-%{srcname}-doc -Documentation for python-ansible-compat - -%package -n python3-%{srcname} -Summary: %summary - - -%description -n python3-%{srcname} %{common_description} - -%prep -%autosetup - -%generate_buildrequires -%pyproject_buildrequires - -%build -%pyproject_wheel - -%if %{with doc} -PYTHONPATH=src sphinx-build-3 docs html -rm -rf html/.{doctrees,buildinfo} -%endif - -%install -%pyproject_install -%pyproject_save_files ansible_compat - -%if %{with tests} -%check -%pytest -vv test -k \ - %{shrink: - ' - not test_prepare_environment_with_collections - and not test_prerun_reqs_v1 - and not test_prerun_reqs_v2 - and not test_install_collection_from_disk - and not test_require_collection - ' - } -%endif - -%files -n python3-%{srcname} -f %{pyproject_files} -%license LICENSE - -%if %{with doc} -%files -n python-%{srcname}-doc -%license LICENSE -%doc *.rst -%doc html/ -%endif - -%changelog diff --git a/pyproject.toml b/pyproject.toml index 75a7c77f..bc2b4bd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ - "setuptools >= 61.0", # PEP-621 - "setuptools_scm[toml] >= 7.0.0", + "setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration and editable installs + "setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme ] build-backend = "setuptools.build_meta" @@ -155,3 +155,4 @@ known-third-party = ["packaging"] [tool.setuptools_scm] local_scheme = "no-local-version" +write_to = "src/ansible_compat/_version.py" diff --git a/requirements.txt b/requirements.txt index bb422305..28cba460 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --extra=docs --extra=test --output-file=requirements.txt --resolver=backtracking --strip-extras --unsafe-package=ansible-core --unsafe-package=resolvelib --unsafe-package=typing_extensions pyproject.toml +# pip-compile --extra=docs --extra=test --output-file=requirements.txt --strip-extras --unsafe-package=ansible-core --unsafe-package=resolvelib --unsafe-package=typing_extensions pyproject.toml # argparse-manpage==4.2 # via ansible-compat (pyproject.toml) diff --git a/tox.ini b/tox.ini index b599f0a4..1d3e47eb 100644 --- a/tox.ini +++ b/tox.ini @@ -8,6 +8,9 @@ envlist = py{39,310,311}{,-devel,-ansible212,-ansible213,-ansible214,-ansible215} isolated_build = true skip_missing_interpreters = True +requires = + tox >= 4.6.3 + setuptools >= 65.3.0 # editable installs [testenv] description = @@ -24,7 +27,7 @@ deps = ansible214: ansible-core>=2.14,<2.15 ansible215: ansible-core>=2.15,<2.16 - devel: ansible-core @ git+https://github.com/ansible/ansible.git # GPLv3+ + devel: ansible-core @ git+https://github.com/ansible/ansible.git@c5d18c39d81e2b3b10856b2fb76747230e4fac4a # GPLv3+ # avoid installing ansible-core on -devel envs: !devel: ansible-core extras =