Skip to content

Commit

Permalink
adds test for cross index dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
CNDW committed Jun 27, 2023
1 parent df474e3 commit 92ca96f
Show file tree
Hide file tree
Showing 10 changed files with 237 additions and 114 deletions.
80 changes: 0 additions & 80 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,6 @@
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.black]

This comment has been minimized.

Copy link
@CNDW

CNDW Jun 27, 2023

Author

temporarily removed this, it needs to be added back in if this branch is going to go somewhere

line-length = 90
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.github
| \.hg
| \.mypy_cache
| \.tox
| \.pyre_configuration
| \.venv
| _build
| buck-out
| build
| dist
| pipenv/vendor
| pipenv/patched
| tests/pypi
| tests/test_artifacts
| get-pipenv.py
| pyproject.toml
)
'''

[tool.mypy]
ignore_missing_imports = true
Expand All @@ -35,32 +10,6 @@ html_report = "mypyhtml"
python_version = "3.7"
mypy_path = "typeshed/pyi:typeshed/imports"

[tool.pytest.ini_options]
addopts = "-ra"
plugins = "xdist"
testpaths = ["tests"]
# Add vendor and patched in addition to the default list of ignored dirs
# Additionally, ignore tasks, news, test subdirectories and peeps directory
norecursedirs = [
".*", "build",
"dist",
"CVS",
"_darcs",
"{arch}",
"*.egg",
"vendor",
"patched",
"news",
"tasks",
"docs",
"tests/test_artifacts",
"tests/pypi",
"peeps",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
# These are not all the custom markers, but most of the ones with repeat uses
# `pipenv run pytest --markers` will list all markers inlcuding these
markers = [
Expand Down Expand Up @@ -90,35 +39,6 @@ markers = [
"ext: extra non-categorized tests",
]

[tool.ruff]
exclude = [
"pipenv/patched/*",
"pipenv/vendor/*",
]
select = [
"B",
"C9",
"E",
"F",
"G",
"I",
"ISC",
"PIE",
"PL",
"TID",
"W",
"YTT"
]
ignore = [
"B028",
"B904",
"PIE790",
"PLR2004",
"PLR5501",
"PLW2901",
]
line-length = 137
target-version = "py37"

[tool.ruff.mccabe]
max-complexity = 32
Expand Down
2 changes: 2 additions & 0 deletions tests/fixtures/private-package-a/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm>=3.3.1"]
Empty file.
44 changes: 44 additions & 0 deletions tests/fixtures/private-package-a/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import ast
import os

from setuptools import setup, find_packages

ROOT = os.path.dirname(__file__)

PACKAGE_NAME = "private_package_a"

VERSION = None

with open(os.path.join(ROOT, "src", PACKAGE_NAME.replace("-", "_"), "__init__.py")) as f:
for line in f:
if line.startswith("__version__ = "):
VERSION = ast.literal_eval(line[len("__version__ = ") :].strip())
break
if VERSION is None:
raise OSError("failed to read version")

setup(
name=PACKAGE_NAME,
# These really don't work.
package_dir={"": "src"},
packages=find_packages("src"),
# I don't know how to specify an empty key in setup.cfg.
package_data={
"": ["LICENSE*", "README*"],
},
install_requires=[
"six>=0.0.1",
"private-package-b>=0.0.1",
],
description="A fake python package.",
author="Dan Ryan",
author_email="[email protected]",
url="https://github.com/sarugaku/legacy_backend_package",
classifiers=[
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python",
],
setup_requires=["setuptools-git-versioning"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.1"
2 changes: 2 additions & 0 deletions tests/fixtures/private-package-b/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm>=3.3.1"]
Empty file.
41 changes: 41 additions & 0 deletions tests/fixtures/private-package-b/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import ast
import os

from setuptools import setup, find_packages

ROOT = os.path.dirname(__file__)

PACKAGE_NAME = "private_package_b"

VERSION = None

with open(os.path.join(ROOT, "src", PACKAGE_NAME.replace("-", "_"), "__init__.py")) as f:
for line in f:
if line.startswith("__version__ = "):
VERSION = ast.literal_eval(line[len("__version__ = ") :].strip())
break
if VERSION is None:
raise OSError("failed to read version")

setup(
name=PACKAGE_NAME,
# These really don't work.
package_dir={"": "src"},
packages=find_packages("src"),
# I don't know how to specify an empty key in setup.cfg.
package_data={
"": ["LICENSE*", "README*"],
},
install_requires=[],
description="A fake python package.",
author="Dan Ryan",
author_email="[email protected]",
url="https://github.com/sarugaku/legacy_backend_package",
classifiers=[
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python",
],
setup_requires=["setuptools-git-versioning"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.1"
Loading

0 comments on commit 92ca96f

Please sign in to comment.