Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3-dnsrecon: update to 1.1.5. #47317

Closed
wants to merge 2 commits into from

Conversation

jason1987d
Copy link
Contributor

@jason1987d jason1987d commented Nov 19, 2023

Testing the changes

  • I tested the changes in this PR: YES

Testing zone transfer in some cases fails. Runs when packaged without tests and other tests pass. Zone transfer is disabled for tests in this template.

@jason1987d jason1987d changed the title Python3 dnsrecon [WIP] Python3 dnsrecon Nov 19, 2023
@jason1987d jason1987d marked this pull request as draft November 19, 2023 20:02
@jason1987d jason1987d changed the title [WIP] Python3 dnsrecon [WIP] python3-dnsrecon: update to 1.1.5. Nov 19, 2023
revision=2
build_style=python3-module
hostmakedepends="python3-setuptools"
depends="python3 python3-netaddr python3-dnspython python3-lxml python3-flake8 python3-setuptools"
depends="python3 python3-netaddr python3-dnspython python3-lxml python3-flake8 python3-setuptools python3-pyflakes"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of python3-flake8, python3-pyflakes or python3-setuptools belong in depends.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that, will push shortly, still trying to figure out what to do about some zone transfer failing, perhaps just patch to remove some of that?

@jason1987d
Copy link
Contributor Author

But moving flake to just checkdepends, packaging and installing without these flake packages present... results in this error.

$ dnsrecon
Traceback (most recent call last):
  File "/usr/bin/dnsrecon", line 33, in <module>
    sys.exit(load_entry_point('dnsrecon==1.1.5', 'console_scripts', 'dnsrecon')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/dnsrecon", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1304, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/lib/python3.12/site-packages/dnsrecon/__init__.py", line 1, in <module>
    import pkg_resources
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 3327, in <module>
    @_call_aside
     ^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 3302, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 3340, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 631, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 968, in require
    needed = self.resolve(parse_requirements(requirements))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 829, in resolve
    dist = self._resolve_dist(
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pkg_resources/__init__.py", line 870, in _resolve_dist
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'flake8' distribution was not found and is required by dnsrecon

@ahesford
Copy link
Member

Pull this patch which removes superfluous runtime dependencies.

@jason1987d
Copy link
Contributor Author

Pull this patch which removes superfluous runtime dependencies.

Trying to find the correct syntax for the dev diff file here.

--- a/requirements.txt	2023-11-19 15:09:58.534925710 -0600
+++ b/requirements-dev.txt	2023-11-19 15:25:45.599952918 -0600
@@ -1,3 +1,5 @@
-dnspython>=2.0.0
-netaddr
-lxml
+-r requirements.txt
+pytest
+black==23.7.0
+flake8==6.1.0
+isort==5.12.0

@ahesford
Copy link
Member

The requirements-dev.txt file is irrelevant, so you can just drop that part of the patch.

@jason1987d
Copy link
Contributor Author

jason1987d commented Nov 19, 2023

The requirements-dev.txt file is irrelevant, so you can just drop that part of the patch.

I figured out the patch syntax. Is that file only irrelevant I assume if I skip tests?

I have the package itself working at least, thank you for pointing out the obvious patch.

@ahesford
Copy link
Member

The file is probably irrelevant even if you run tests, because I doubt anything is reading it.

@jason1987d
Copy link
Contributor Author

Zone transfer test failure submitted as issue darkoperator/dnsrecon#251

Copy link
Member

@ahesford ahesford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your two patches should instead be a single file which is just pulled directly from https://github.com/darkoperator/dnsrecon/commit/d0507ef2499d9cc3c3354e1c0632cfc5898a9bf3.patch

I'm not sure I'd expect the zone-transfer test to work, as I assume that there is some DNS setup required as a prerequisite. Skipping this test with something like

make_check_args="-k not(test_zone_transfer)"

might be sufficient.

@jason1987d jason1987d changed the title [WIP] python3-dnsrecon: update to 1.1.5. python3-dnsrecon: update to 1.1.5. Nov 26, 2023
@jason1987d jason1987d marked this pull request as ready for review November 26, 2023 05:48
@jason1987d
Copy link
Contributor Author

Although pyflakes is not actually necessary to run, I have the update for it in here anyway, since it likely could use the update. Is this good?

@ahesford
Copy link
Member

When I say to pull the upstream patch, I literally mean

curl -L -o requirements.patch https://github.com/darkoperator/dnsrecon/commit/d0507ef2499d9cc3c3354e1c0632cfc5898a9bf3.patch

Using the upstream patch verbatim provides a "chain of custody" with headers that show the upstream commit hash and original author.

@jason1987d
Copy link
Contributor Author

When I say to pull the upstream patch, I literally mean

curl -L -o requirements.patch https://github.com/darkoperator/dnsrecon/commit/d0507ef2499d9cc3c3354e1c0632cfc5898a9bf3.patch

Using the upstream patch verbatim provides a "chain of custody" with headers that show the upstream commit hash and original author.

I did that, and it leads to...

=> python3-dnsrecon-1.1.5_1: patching: requirements.patch.
1 out of 1 hunk FAILED -- saving rejects to file requirements.txt.rej
=> ERROR: python3-dnsrecon-1.1.5_1: do-patch_00-patches: 'patch -s ${_args} < "${_patch}" 2> /dev/null' exited with 1

@ahesford
Copy link
Member

My mistake; it seems there were some preceding changes to requirements.txt that were not in the release. What you have currently is fine.

@ahesford ahesford closed this in 51d7c1f Nov 27, 2023
jason1987d pushed a commit to jason1987d/void-packages that referenced this pull request Dec 8, 2023
@jason1987d jason1987d deleted the python3-dnsrecon branch December 8, 2023 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants