GreyNoise-Intelligence / pygreynoise

Python3 library and command line for GreyNoise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add structlog version >= 18.1.0 to requirements

FileMagic opened this issue · comments

Hey all, while doing some testing I found that structlog 18.1.0 should be required.

The release notes for structlog shows that is_configured was added in 18.1.0. ChangeLog here: https://github.com/hynek/structlog/blob/ce7cf4ee09c407e2c5ca085a9fdd51be917d47f5/CHANGELOG.md#1810---2018-01-27

The following is where is_configured is used:

if not structlog.is_configured():

I can add a PR for this if that helps. Thanks for your time!

Thanks for the heads up and sorry for the oversight! Will get this added, we're about to push a new release, so I'll make sure this is included.

Oh, whoops, looks like it is already there:

structlog==21.5.0;python_version>='3.6'

Which version of the SDK are you seeing it missing?

Ahhh, I see, I was looking here:

"structlog",

under the INSTALL_REQUIRES. Which I think that most packaging uses. This is my fault!

One thing to note here, is that by putting it in this manner may only impact when you do a pip install -r requirements. However, when using https://setuptools.pypa.io/en/latest/userguide/dependency_management.html#optional-dependencies you could potentially do something like the following which is referred to in the pypa.io docs here under options so that setuptools acknowledges the requirements that are in the requirements folder:

INSTALL_REQUIRES = [
    "Click>=7.1.2",
    "ansimarkup",
    "cachetools",
    "click-default-group",
    "click-repl",
    "dict2xml",
    "jinja2",
    "more-itertools",
    "requests",
    "six",
    "structlog",
]
setup(
    name="greynoise",
    ...,
    install_requires=INSTALL_REQUIRES,
    extras_require={
        "dev": ["advbumpversion==1.2.0", "ipython==8.6.0", "pre-commit==2.20.0", "tox==3.27.0"],
    },
)

The issue I ran into is due to the requirements under the requirements folder not being acknowledged by pip when creating the wheel.

I wanted to document this in case someone else runs into this in the future.

@FileMagic : I think we need to make sure our install_requires are in line with the common.txt as well (it seems they got out of sync). I'm about to push a new release and have this queued up. You shouldn't need any of the dependencies for dev, docs, or test unless you are actively helping to develop the SDK, so I believe this meets your needs for the WHL generation. Can you check this out:

https://github.com/GreyNoise-Intelligence/pygreynoise/blob/03887f8e021d3d9a276a49d9c3054bc65da216ea/setup.py

Yep that looks great thanks again!

I apologize one last thing, I think you can remove structlog as a dependency as well, for I think you removed it last patch in v1.3.0:

https://github.com/GreyNoise-Intelligence/pygreynoise/blob/7428ab4a1776e3ea09f946da4c4e3e1e9178081b/CHANGELOG.rst#version-130

Dependencies:

    Updated Click to 8.1.3
    Updated colorama to 0.4.5
    Updated jinja2 to 3.1.2
    Updated more-itertools to 8.14.0
    Update requests to 2.28.1
    Removed structlog

Yup, look at that. It will be properly cleaned up in the new version.