Coder Social home page Coder Social logo

pipenv-setup's Introduction

Pipenv-Setup

travis-badge ci PyPI pyversions codecov PyPI version Very popular Code style: black

A beautiful python package development tool: sync dependencies in Pipfile or Pipfile.lock to setup.py.

Never need again to change dependencies manually in setup.py, and enjoy the same dependency locking or semantic versioning.

Or just check whether setup.py and Pipfile are consistent and sync dependency when necessary.

Installation

Create a command line entry point pipenv-setup, and add pipenv-setup as a dev package in Pipfile:

pipenv install --dev pipenv-setup

Additionally, black can be included as package extras:

pipenv install --dev "pipenv-setup[black]"  

Features

Beautiful pipenv flavored help

$ pipenv-setup

help

Sync to setup.py

  • supports assorted package configuration. You can have a pipfile as ugly as you want:

    [package]
    requests = { extras = ['socks'] }
    records = '>0.5.0'
    django = { git = 'https://github.com/django/django.git', ref = '1.11.4', editable = true }
    "e682b37" = {file = "https://github.com/divio/django-cms/archive/release/3.4.x.zip"}
    "e1839a8" = {path = ".", editable = true}
    pywinusb = { version = "*", os_name = "=='nt'", index="pypi"}
    

    pipenv-setup will still figure things out:

    $ pipenv-setup sync
    package e1839a8 is local, omitted in setup.py
    setup.py successfully updated
    23 packages from Pipfile.lock synced to setup.py

    And things will be where they should be:

    # setup.py
    setup(...,
      install_requires=[
          "requests[socks]",
          "records>0.5.0",
          "django @ git+https://github.com/django/[email protected]",
          "https://github.com/divio/django-cms/archive/release/3.4.x.zip",
          "pywinusb; os_name == 'nt'",
      ]
    )
  • provide --dev flag to sync development packages with extras_require:

    $ pipenv-setup sync --dev
    setup.py successfully updated
    1 default packages from Pipfile.lock synced to setup.py
    1 dev packages from Pipfile.lock synced to setup.py
    # produced setup.py
    setup(...,
        extras_require={"dev": ["pytest==1.1.3",]},
        install_requires=["xml-subsetter==0.0.1"],
    )
  • produce beautiful Blackened setup.py file

  • Template generation with filled dependencies in the absence of a setup file.

    $ pipenv-setup sync
    setup.py not found under current directory
    Creating boilerplate setup.py...
    setup.py was successfully generated
    23 packages synced from Pipfile.lock to setup.py
    Please edit the required fields in the generated file

    Note: by default, pipenv-setup syncs lockfile instead of pipfile

Sync Pipfile vs. Pipfile.lock

Provide --pipfile flag to sync Pipfile instead of Pipfile.lock.

pipenv-setup will perform a liquid sync using semantic versioning taken from Pipfile (instead of using frozen pinned versions from Pipfile.lock):

$ pipenv-setup sync --pipfile
setup.py was successfully updated
23 packages synced from Pipfile to setup.py

Checks Only

run $ pipenv-setup check

  • checks four items

    • local package in default pipfile packages
    • Package version requirements in install_requires in setup.py that potentially violates Pipfile
    • Package version requirements in dependency_links in setup.py that differs from Pipfile
    • Default package in pipfile missing in install_requires or dependency_links in setup.py
  • exits with non-zero code when conflict found (can be used in travis-ci)

  • here is a somewhat extreme example:

    $ pipenv-setup check
    package 'numpy' has version string: >=1.2 in setup.py, which potentially violates >=1.5 in pipfile
    package 'pywinusb' has version string: ==0.4.2 in setup.py, which is disjoint from ~=0.3.0 in pipfile
    package 'records' has version string: >=0.4.2,<0.5 in setup.py, which is disjoint from >0.5.0 in pipfile
    package 'django' has branch/version 1.11.5 in dependency_links, which is different than 1.11.4 listed in pipfile
    package 'requests' in pipfile but not in install_requires
    package 'e682b37' has a url in pipfile but not in dependency_links
    (exits with 1)
  • provide --ignore-local flag to allow local packages in pipfile

    $ pipenv-setup check
    local package found in default dependency: e1839a8.
    Do you mean to make it dev dependency
    (exits with 1)
    $ pipenv-setup check --ignore-local
    No version conflict or missing packages/dependencies found in setup.py!
    (exits with 0)
  • provide --strict flag to only pass identical version requirements

    By default pipenv-setup check passes when the version setup.py specifies is "compatible" with Pipfile, i.e. is a subset of it. For example, a Pipfile specifying django~=1.1 with setup.py requiring django==1.2 is such a case.

    Provide --strict to allow only identical requirements; i.e. for Pipfile's django~=1.1, setup.py must require django>=1.1,<2.0

    Example output:

    $ pipenv-setup check --strict
    package 'pywinusb' has version string: ==0.4.2 in setup.py, which specifies a subset of * in pipfile
    package 'django' has version string: >=0.5 in setup.py, which is disjoint from ~=0.3.0 in pipfile
    package 'records' has version string: ==0.5.2 in setup.py, which specifies a subset of >0.5.0 in pipfile
    package 'requests' has version string: ==2.18.4 in setup.py, which specifies a subset of * in pipfile
    (exits with 1)
  • provide --lockfile flag to check setup.py against Pipfile.lock instead of Pipfile

    By default, pipenv-setup check compares the dependencies from setup.py against the dependencies listed in Pipfile. This works well for most cases, but there are some exceptions that break this strategy, including (but not necessarily limited to):

    • VCS dependencies with a mutable ref (e.g. - git branch name instead of a tag or commit sha)
      • Because these resolve to an immutable pointer (e.g. - commit sha) in setup.py, the dependency will no longer match between setup.py and Pipfile. However, Pipfile.lock will contain the same resolved pointer as setup.py.

Pre-commit integration

You can run pipenv-setup automatically using a pre-commit hook. To get started, add this configuration to your .pre-commit-config.yaml:

- repo: https://github.com/Madoshakalaka/pipenv-setup
  rev: "4.0.0a1" # pick a git hash / tag to point to
  hooks:
    - id: pipenv-setup

This configuration will execute pipenv-setup sync --pipfile on changes to Pipfile, Pipfile.lock, and setup.py.

You can also customize the default args ("--pipfile"). For example, to synchronize --dev extras:

- repo: # ...
  hooks:
    - id: pipenv-setup
      args: [--dev, --pipfile]

If using the hook during CI (or in another environment separate from a black installation), you can include the appropriate auto-formatter with the hook:

- repo: # ...
  hooks:
    - id: pipenv-setup
      additional_dependencies: [".[black]"]

Contributing

If you'd like to contribute to pipenv-setup, see Contribution Guide

pipenv-setup's People

Contributors

bryant-finney avatar dependabot[bot] avatar jbraswell avatar jrottenberg avatar jshwi avatar lsimonetto avatar madoshakalaka avatar rusnyder avatar shaybensasson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pipenv-setup's Issues

run checks without updating setup.py file

Is it a lot of trouble to add a pipenv-setup check command that merely validates if the Pipfile and setup.py file are synchronized, with corresponding exit codes?

install from GitHub feature branches do not transfer to setup.py correctly

The install in my Pipfile is as follows:

ids = {editable = true,git = "ssh://[email protected]/qbio/immutable-data-store.git",ref = "feature/s3-key-manipulation"}

The transferred package to setup.py is:

"git+ssh://[email protected]/qbio/immutable-data-store.git@3636a992596cb555d08e8d31c4854a15e9d006a7#egg=ids"

It appears pipenv-setup transfers the commit hash instead of the branch name. Which then causes future invocations of pipenv-setup check to fail.

Deprecate support for EOL Python versions on MacOS

Summary

PR #79 introduces GitHub actions for performing CI/CD. The pipeline executes the test suite across all supported Python versions on multiple operating systems.

actions/runner-images#4060 updates the macOS-latest workflow to reference macOS-11 (from macOS-10.5); this is expected to remove support for Python versions 2.7, 3.5, and 3.6. Accordingly, the GitHub actions configuration must be updated to accommodate this change.

Definition of Done

  • CI tests for macOS are skipped/allowed to fail/expected to fail for Python 2.7, 3.5, and 3.6 on macOS

Update colorama to >= 0.4.3

This utility is extremely useful, however most other packages that this might need to coexist with seem to require at least 0.4.3 of colorama.

The error I seem to receive (strangely when running only in a container (Python 3.7.6) is a ModuleNotFoundError: No module named 'colorama' from main.py line 18.

I'd have thought pipenv itself on my project would have complained about the missmatch, I am making an assumption that it's not finding colorama because a later version is installed?

I'm using v2.2.5 of pipenv-setup.

Setup.py template missing from distribution

I have a private project I've been managing with pipenv. Installed pipenv-setup to make it easier to distribute internally, but am running into a 'Can not find setup.py template file' error when trying to generate the initial setup.py

$ pipenv install --dev pipenv-setup
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. You can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.
Installing pipenv-setup…
Adding pipenv-setup to Pipfile's [dev-packages]…
✔ Installation Succeeded
Pipfile.lock (b9df1f) out of date, updating to (5cc7a7)…
Locking [dev-packages] dependencies…
✔ Success!
Locking [packages] dependencies…
✔ Success!
Updated Pipfile.lock (b9df1f)!
Installing dependencies from Pipfile.lock (b9df1f)…
$ grep -A 6 pipenv-setup Pipfile.lock
"pipenv-setup": {
"hashes": [
"sha256:9c8bb190960150dc437bcb815bfa0b916ea6b76897488694e479efe79864ee6d"
],
"index": "pypi",
"version": "==2.1.6"
},
$ pipenv-setup sync
setup.py not found under current directory
Creating boilerplate setup.py...
[Errno 2] No such file or directory: '[virtualenv-path-elided]/lib/python3.7/site-packages/pipenv_setup/res/setup_template.py'
pipenv-setup failed to create setup.py
Can not find setup.py template file

$ ls -lR [virtualenv-path-elided]/lib/python3.7/site-packages/pipenv_setup
total 128
-rw-r--r-- 1 mcable staff 0 Oct 17 13:10 init.py
-rw-r--r-- 1 mcable staff 292 Oct 17 13:10 main.py
drwxr-xr-x 13 mcable staff 416 Oct 17 13:10 pycache
-rw-r--r-- 1 mcable staff 379 Oct 17 13:10 constants.py
-rw-r--r-- 1 mcable staff 19718 Oct 17 13:10 inconsistency_checker.py
-rw-r--r-- 1 mcable staff 2315 Oct 17 13:10 lock_file_parser.py
-rw-r--r-- 1 mcable staff 7557 Oct 17 13:10 main.py
-rw-r--r-- 1 mcable staff 608 Oct 17 13:10 msg_formatter.py
-rw-r--r-- 1 mcable staff 1727 Oct 17 13:10 pipfile_parser.py
-rw-r--r-- 1 mcable staff 1182 Oct 17 13:10 setup_filler.py
-rw-r--r-- 1 mcable staff 2965 Oct 17 13:10 setup_parser.py
-rw-r--r-- 1 mcable staff 5391 Oct 17 13:10 setup_updater.py

pipenv-setup sync errors with TypeError on Windows

The following error occurs for versions<=2.2.2, it's been fixed in version 2.2.3. Please download newer versions.

> pipenv-setup sync

Traceback (most recent call last):
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python37\Lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python37\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "F:\-nY6vOo6n\Scripts\pipenv-setup.exe\__main__.py", line 7, in <module>
  File "f:\-ny6voo6n\lib\site-packages\pipenv_setup\main.py", line 84, in cmd
    sync(argv)
  File "f:\-ny6voo6n\lib\site-packages\pipenv_setup\main.py", line 271, in sync
    dependency_arguments, setup_file_path, argv.dev
  File "f:\-ny6voo6n\lib\site-packages\pipenv_setup\setup_updater.py", line 139, in update_setup
    format_file(Path("setup.py"))
  File "f:\-ny6voo6n\lib\site-packages\pipenv_setup\setup_updater.py", line 151, in format_file
    [sys.executable, "-m", "black", file], stdout=PIPE, stderr=PIPE
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python37\Lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python37\Lib\subprocess.py", line 1119, in _execute_child
    args = list2cmdline(args)
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python37\Lib\subprocess.py", line 530, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

Keyword dependency_links is not found

check command will fail if dependency_links is not present in setup.py. Is it intended that we need an (empty) dependency_links=[] in setup.py to get the ckeck command passed?

`chardet` dependency not in your Pipfile

I have tried to install pipenv-setup as shown in your README (pipenv install --dev pipenv-setup).
When using sync (pipenv run pipenv-setup sync) I get the message ModuleNotFoundError: No module named 'chardet'. Your Pipfile doesn't contain it as far as I can tell, so I had to pipenv install --dev chardet.
Is this intended? It seems like a bug to me.

Support Python 3.10

This issue includes the following:

  • add CI tests for 3.10
  • make any additional changes to dependencies, code, etc.

#89 should be completed first

pipenv-setup check fails to handle [extras]

Minimal example: hopefully enough to follow as it is an extract from a larger project.

Pipfile

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
uvicorn = {extras = [ "standard",]}

pipenv-setup generates:

        "uvicorn[standard]==0.13.3",

however:

pipenv-setup check
package 'uvicorn' in pipfile but not in install_requires

expected behaviour:
check can find the translated dependency.

Security Patches

A I noticed a handful of the dependencies in test data packages are flagged with security vulnerabilities.

Do you think it's worth running through the github auto-generated PRs to update these test data packages? Or is it unsafe to assume that vulnerable test packages are not intended in these test cases?

Add job to publish to PyPI

Summary

PR #79 added a configuration for GitHub actions to run the test suite for CI. This issue tracks the addition of a configuration for publishing releases to PyPI.

Definition of Done

The GH actions configuration has been updated to publish releases according to the following rules:

  • all tests pass
  • the CI/CD pipeline is running for a release

Support Python 3.9

This issue includes the following:

  • add CI tests for 3.9
  • make any additional changes to dependencies, code, etc.

Python 3.5 and 3.7 Windows travis builds timeout

here is the build output

Despite line 275: Done. Your build exited with 0.

The build hangs and errors out after 10 minutes of inactivity.

I have found discussions online saying that Windows background process stops the build from finishing. And there is a command that compares windows processes before and after the build

I'm not spending time on this for now. and I have disabled testing on Windows pythno 3.5 and 2.7 since.

Though the support for Python 2.7 is officially dropped. But python 3.5 build is worthwhile to save. So this issue has its value to solve.

I'd appreciate if anyone wants to help.

Tests for python 2.7, MacOS fails on Travis

This build shows the test fails uniquely on python 2.7 MacOS, but not on Windows/Linux.

This issue of pytest might be related.

My speculation is that py>=1.5 should be installed but somehow on MacOS, py==1.4.34 is installed on travis. (See build log line #240)

Another concern is that in the build config. The first several lines of script is meant to upgrade pip on MacOS. Yet the build log still shows warnings about outdated pip, meaning we failed to upgrade pip.

I'm not actively investigating this as first, this issue is caused by pytest and won't affect functionality, second, tests are still conducted on Windows and MacOS, and third, python 2.7 has reached its end of life.

Still, help is appreciated!!

Preserve comments

This might be worthwhile looking into

Before pipenv-setup sync --pipfile

setup(
    ...
    include_package_data=True,
    zip_safe=False,
    install_requires=[
        "appdirs>=1.4.4, <=2.0.0",
        # appears the version needs to be strictly specified in order
        # for `pipenv` to allow locking without the additional argument
        "black==21.7b0",
        ...
    ],
    ...
)

After pipenv-setup sync --pipfile

setup(
    ...
    include_package_data=True,
    zip_safe=False,
    install_requires=[
        "appdirs>=1.4.4, <=2.0.0",
        "black==21.7b0",
        ...
    ],
    ...
)

Check fails for range specifiers

Description

Running pipenv-setup check for a Pipfile that has a range specifier (~) in both the Pipfile and setup.py results in a failed check, even though the dependency has been satisfied.

Steps to Reproduce

  1. Create the following Pipfile:

    [[source]]
    name = "pypi"
    url = "https://pypi.org/simple"
    verify_ssl = true
    
    [packages]
    click = "~=7.1.1"
    
    [dev-packages]
    pipenv-setup = "==3.1.1"
  2. Install the environment:

    $ pipenv install -d
    Creating a virtualenv for this project…
    Pipfile: /Users/jduckworth/managed_code/pipenv-test/Pipfile
    Using /Users/jduckworth/.pyenv/shims/python (3.7.3) to create virtualenv…
    ⠇ Creating virtual environment...created virtual environment CPython3.7.3.final.0-64 in 518ms
      creator CPython3Posix(dest=/Users/jduckworth/.local/share/virtualenvs/pipenv-test-nGQVbywM-/Users/jduckworth/.pyenv/shims/python, clear=False, global=False)
      seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/jduckworth/Library/Application Support/virtualenv/seed-app-data/v1.0.1)
      activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
    
    ✔ Successfully created virtual environment!
    Virtualenv location: /Users/jduckworth/.local/share/virtualenvs/pipenv-test-nGQVbywM-/Users/jduckworth/.pyenv/shims/python
    Pipfile.lock not found, creating…
    Locking [dev-packages] dependencies…
    Building requirements...
    Resolving dependencies...
    ✔ Success!
    Locking [packages] dependencies…
    Building requirements...
    Resolving dependencies...
    ✔ Success!
    Updated Pipfile.lock (0e1e0f)!
    Installing dependencies from Pipfile.lock (0e1e0f)…
      🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 33/33 — 00:00:21
    To activate this project's virtualenv, run pipenv shell.
    Alternatively, run a command inside the virtualenv with pipenv run.
  3. Sync using the --pipfile flag to maintain the version range:

    $ pipenv run pipenv-setup sync --pipfile
    setup.py not found under current directory
    Creating boilerplate setup.py...
    setup.py was successfully generated
    1 default packages synced from Pipfile to setup.py
    Please edit the required fields in the generated file

    This produces the following install_requires argument in setup.py file, which has the expected version range:

    # ...
    
    setup(
        # ...
        # For an analysis of "install_requires" vs pip's requirements files see:
        # https://packaging.python.org/en/latest/requirements.html
        install_requires=["click~=7.1"],  # Optional
        # ...
    )
  4. Check the sync:

    $ pipenv run pipenv-setup check
    package 'click' in pipfile but not in install_requires
    

Security Updates

Several dependencies in the test datasets contain security vulnerabilities. These are not project dependencies and are only used to test the application with representative operations.

Accordingly, this is not a high-priority issue and receives the chore label.

While merging dependabot PRs, might as well add a code scanning workflow for CodeQL.

Markers missing on pipenv-setup check

Description

Running pipenv-setup check for a Pipfile that has a marker (PEP 496) should fail if the marker is not in the setup.py.
Note: the pipenv-setup sync propagates the marker, we do see it in the setup.py, but the check is not enforcing it.

Steps to Reproduce

Pipfile

[[source]]
verify_ssl = true

[packages]
pyqt5 = {version = "*", sys_platform = "!= 'Linux'"}


[requires]
python_version = "3"

setup.py

[...]
    install_requires=["pyqt5"],
[...]

Expected

package 'pyqt5' in pipfile but no marker in install_requires

Got

pipenv-setup  check
No version conflict or missing packages/dependencies found in setup.py!

Note : pipenv-setup sync will do the right thing, but the check should tell us if sync would generate a file different from the current setup.py.

Git(hub) dependencies not handled correctly

Context

I have a package dependency in the form of my-repository = {git = "ssh://[email protected]/myorganization/my-repository.git",ref = "feature/my-feature"} in my Pipfile, which gets translated into an install_requires dependency in the form of git+ssh://[email protected]/myorganization/my-repository.git@f2b9a9874d9d112a55ed963e82bdfb2a552a224e#egg=my-repository.

Problem

Trying to install from setup.py produces Invalid requirement, parse error at "'+ssh://g'".

Solution

my-repository @ git+ssh://[email protected]/myorganization/my-repository.git@f2b9a9874d9d112a55ed963e82bdfb2a552a224e#egg=my-repository as found here.

Support plette version 1.0.0

On using pipenv-setup, you will get an error called plette.models not a package.

from pipenv_setup import pipfile_parser as parser

This is because the underlying plette package was updated to 1.0.0 with some breaking changes.

For now I just downgraded the version of plette to use pipenv-setup, but @Madoshakalaka you might want to look into it

sync-then-check fails with underscores

… sync then … check fails when there is an underscore in a package name in Pipfile

Steps to reproduce

  1. Check out https://github.com/jonwolski/pipenv-setup_sync_check
  2. pipenv install --dev
  3. Ensure the setup.py is up to date by running the sync command
    pipenv run pipenv-setup sync --pipfile
    
  4. Confirm the sync worked by running a check
    pipenv run pipenv-setup check
    

Expected behavior

The ... check command succeeds with exit code 0 and the following message:

No version conflict or missing packages/dependencies found in setup.py!

Actual behavior

The ... check command fails with exit code 1 and the following message:

package 'foo_f' in pipfile but not in install_requires

Details

I expected that I could run pipenv-setup sync --pipfile and that would
ensure that a subsequent pipenv-setup check would succeed. However, if I have
an underscore (_) in a package name in my Pipfile, the sync command will
automatically translate the _ to -. The check command does no such
translation, so it fails to find a match for the package in the Pipfile.

I am not sure if this is a bug. A bug is literally a discrepancy between
expected behavior and actual behavior, but it is unclear if my expectations
are correct. It is unusual to have an underscore in a package name, because
installing via the command line (pipenv install --dev foo_f) will handle the
translation before saving to the Pipfile. In that hypothetical example,
pipenv sync ... && ... check would have succceeded.

fix for assert '_distutils' in core.__file__, core.__file__ failing

looks like something broke in the setuptools project in the last couple of days, and consequently, pipenv-setup errors out when called. This should only happen with the latest pip version but I am not 100% sure.

Anyway, a quick fix for this is to export an env var before calling the command, like below

export SETUPTOOLS_USE_DISTUTILS=stdlib
pipenv-setup check

cheers!

How to get the pre-commit example working?

The documentation shows v4.0.0a1 which returns:

error: pathspec 'v4.0.0a1' did not match any file(s) known to git

Using 3.2.0 returns ModuleNotFoundError: No module named 'vistir.compat'

.pre-commit-config.yaml:

repos:
- repo: https://github.com/Madoshakalaka/pipenv-setup
  rev: "v3.2.0" # pick a git hash / tag to point to
  hooks:
    - id: pipenv-setup
      language: python
      entry: pipenv-setup
      language_version: python3
      files: Pipfile(\.lock)?|setup\.py

As recommended in #109 my Pipfile does not contain pipenv-setup but relies on pre-commit's auto-install
However I'm able to run pipenv-setup without pre-commit by installing it manually via pipenv and vistir = "0.6.1"

Strict dependency on black prevents usage of the latest black

pipenv-setup depends on black==19.10b0, while the latest black version is 20.8b1. This prevents the usage of pipenv-setup in any project which requires the latest black version (downgrading black is not an option, because 19.10b0 complains about formatting of the files 20.8b1 is happy with).

ModuleNotFoundError: No module named 'vistir.compat'

Today, vistir was updated to version 0.7.0, which no longer has the module path vistir.compat.

This is a breaking change, which affects pipenv-setup, and will be accompanied by the following error:

ModuleNotFoundError: No module named 'vistir.compat'

Verify travis runs tests on Windows and Mac

I fixed a bug in version 2.2.1 where a windows path should be casted to string. It's a serious bug during file formatting, which should error a sync command.

This makes me wonder whether travis tests on Windows (even Mac builds) are properly configured. Here is the travis output on Windows builds, it shows no test progress, just a congratulation:

$ python -m tox
___________________________________ summary ___________________________________
  congratulations :)
The command "python -m tox" exited with 0.

While on linux builds there are detailed test outputs

Allow for varying import styles

Works

from setuptools import setup


setup(
    ...
)

Does not work

import setuptools


setuptools.setup(
    ...
)

Results in:

No setup() call found in setup.py
can not perform sync

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.