DEV Community

Discussion on: Who's looking for open source contributors? (Feb 25th edition)

Collapse
 
adamgold profile image
Adam Goldschmidt

AdamGold / pypkgfreeze

npm install --save for Python.

pypkgfreeze

Python's npm install --save

Code style: black Build Status

Automatically inserts your currently used package versions to setup.py.

Example

Old setup.py

from setuptools import setup
test_req = ['pytest', ]
setup(
    name='pypkgfreeze',
    install_requires=[
        "Click",
    ],
    tests_require=test_req,
    extras_require={
        'test': test_req
    }
)

New setup.py

from setuptools import setup
test_req = ['pytest==4.0.2', ]  # ADDED VERSION HERE
setup(
    name='pypkgfreeze',
    install_requires=[
        "Click==7.0",  # AND HERE
    ],
    tests_require=test_req,
    extras_require={
        'test': test_req
    }
)

Usage

pkgfreeze. It's that simple.

Installation

pip install pypkgfreeze

Contributing

Thanks! Please read the CONTRIBUTING.md file.




It's a tiny Python module designed to inject versions of pip dependencies into setup.py. I am planning to implement AST for a better code injection (for packages that do not yet exist in setup.py) - So it can somehow resemble npm.