Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sify21 authored Dec 20, 2024
2 parents c304eae + cd3f437 commit eddc8ef
Show file tree
Hide file tree
Showing 29 changed files with 2,877 additions and 349 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
name: Tests and Codecov
on: pull_request
on:
push:
pull_request:
workflow_dispatch:

jobs:
run_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, pypy-3.7]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-7.3.12']

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -30,21 +34,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage docopt yarg requests
pip install poetry
poetry install --with dev
- name: Calculate coverage
run: coverage run --source=pipreqs -m unittest discover
run: poetry run coverage run --source=pipreqs -m unittest discover

- name: Create XML report
run: coverage xml
run: poetry run coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
files: coverage.xml
fail_ci_if_error: true
6 changes: 6 additions & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
3.12
3.11
3.10
3.9
3.8
pypy3.9-7.3.12
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.12 3.11 3.10 3.9 3.8 pypy3.9-7.3.12
21 changes: 10 additions & 11 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,11 @@ Ready to contribute? Here's how to set up `pipreqs` for local development.
2. Clone your fork locally::

$ git clone git@github.com:your_name_here/pipreqs.git
$ cd pipreqs/

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
3. Pipreqs is developed using Poetry. Refer to the `documentation <https://python-poetry.org/docs/>`_ to install Poetry in your local environment. Next, you should install pipreqs's dependencies::

$ mkvirtualenv pipreqs
$ cd pipreqs/
$ python setup.py develop
$ poetry install --with dev

4. Create a branch for local development::

Expand All @@ -76,11 +75,11 @@ Ready to contribute? Here's how to set up `pipreqs` for local development.

5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::

$ flake8 pipreqs tests
$ python setup.py test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.
$ poetry run flake8 pipreqs tests
$ poetry run python -m unittest discover
$ poetry run tox
To test all versions of python using tox you need to have them installed and for this two options are recommended: `pyenv` or `asdf`.

6. Commit your changes and push your branch to GitHub::

Expand All @@ -99,7 +98,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.7, 3.4, 3.5, 3.6, and PyPy. Check
3. The pull request should work for currently supported Python and PyPy versions. Check
https://travis-ci.org/bndr/pipreqs/pull_requests and make sure that the
tests pass for all supported Python versions.

Expand All @@ -108,4 +107,4 @@ Tips

To run a subset of tests::

$ python -m unittest tests.test_pipreqs
$ poetry run python -m unittest tests.test_pipreqs
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ help:
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove test and coverage artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests quickly with the default Python"
@echo "test - run tests quickly using the default Python"
@echo "test-all - run tests on every Python version with tox"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "release - package and upload a release"
@echo "dist - package"
@echo "install - install the package to the active Python's site-packages"
@echo "publish - package and upload a release"
@echo "publish-to-test - package and upload a release to test-pypi"
@echo "build - build the package"
@echo "install - install the dependencies into the Poetry virtual environment"

clean: clean-build clean-pyc clean-test

Expand All @@ -35,14 +36,13 @@ clean-test:
rm -fr htmlcov/

lint:
flake8 pipreqs tests
poetry run flake8 pipreqs tests

test:
pip install -r requirements.txt
python setup.py test
poetry run python -m unittest discover

test-all:
tox
poetry run tox

coverage:
coverage run --source pipreqs setup.py test
Expand All @@ -58,13 +58,14 @@ docs:
$(MAKE) -C docs html
open docs/_build/html/index.html

release: clean
python setup.py sdist bdist_wheel upload -r pypi
publish: build
poetry publish

dist: clean
python setup.py sdist
python setup.py bdist_wheel
ls -l dist
publish-to-test: build
poetry publish --repository test-pypi

build: clean
poetry build

install: clean
python setup.py install
poetry install --with dev
11 changes: 10 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,18 @@
Installation
------------

::
.. code-block:: sh
pip install pipreqs
Obs.: if you don't want support for jupyter notebooks, you can install pipreqs without the dependencies that give support to it.
To do so, run:

.. code-block:: sh
pip install --no-deps pipreqs
pip install yarg==0.1.9 docopt==0.6.2
Usage
-----

Expand Down Expand Up @@ -58,6 +66,7 @@ Usage
<compat> | e.g. Flask~=1.1.2
<gt> | e.g. Flask>=1.1.2
<no-pin> | e.g. Flask
--scan-notebooks Look for imports in jupyter notebook files.

Example
-------
Expand Down
2 changes: 1 addition & 1 deletion pipreqs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__author__ = 'Vadim Kravcenko'
__email__ = 'vadim.kravcenko@gmail.com'
__version__ = '0.4.11'
__version__ = '0.4.13'
6 changes: 5 additions & 1 deletion pipreqs/mapping
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BeautifulSoupTests:BeautifulSoup
BioSQL:biopython
BuildbotStatusShields:BuildbotEightStatusShields
ComputedAttribute:ExtensionClass
constraint:python-constraint
Crypto:pycryptodome
Cryptodome:pycryptodomex
FSM:pexpect
Expand Down Expand Up @@ -129,6 +130,7 @@ aios3:aio_s3
airbrake:airbrake_flask
airship:airship_icloud
airship:airship_steamcloud
airflow:apache-airflow
akamai:edgegrid_python
alation:alation_api
alba_client:alba_client_python
Expand Down Expand Up @@ -1030,9 +1032,10 @@ skbio:scikit_bio
sklearn:scikit_learn
slack:slackclient
slugify:unicode_slugify
slugify:python-slugify
smarkets:smk_python_sdk
snappy:ctypes_snappy
socketio:gevent_socketio
socketio:python-socketio
socketserver:pies2overrides
sockjs:sockjs_tornado
socks:SocksiPy_branch
Expand Down Expand Up @@ -1061,6 +1064,7 @@ tasksitter:cerebrod
tastypie:django_tastypie
teamcity:teamcity_messages
telebot:pyTelegramBotAPI
telegram:python-telegram-bot
tempita:Tempita
tenjin:Tenjin
termstyle:python_termstyle
Expand Down
Loading

0 comments on commit eddc8ef

Please sign in to comment.