Skip to content

Commit

Permalink
Merge pull request #74 from damnever/v0.10.0-final
Browse files Browse the repository at this point in the history
V0.10.0 final
  • Loading branch information
damnever authored Mar 14, 2020
2 parents b174b14 + d9c598a commit 2be65ce
Show file tree
Hide file tree
Showing 11 changed files with 166 additions and 183 deletions.
144 changes: 144 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
### Change Logs

#### Version 0.10.rc0 (2020.03.14)

- Refactored the main logic, **the interface has been changed**, be careful if you are using `pigar` as a library.
- Handle the HTTP error, fixed [#61](https://github.com/damnever/pigar/issues/61).
- Ignore local packages quietly, fixed [#47](https://github.com/damnever/pigar/issues/47), [#58](https://github.com/damnever/pigar/issues/58) and [#65](https://github.com/damnever/pigar/issues/65).

Thank [@bganglia](https://github.com/bganglia) for the following contributions:

- Add Jupyter notebook(`.ipynb`) support, refer to [#69](https://github.com/damnever/pigar/issues/69).
- Option to turn off filenames and line numbers in requirements.txt, refer to [#65](https://github.com/damnever/pigar/issues/65).
- Fix check path, refer to [#64](https://github.com/damnever/pigar/issues/64).
- And [more](https://github.com/damnever/pigar/pulls?q=is%3Apr+author%3Abganglia).


#### Version 0.9.2 (2019.04.11)

- Make version comparison operator configurable, fixed [#37](https://github.com/damnever/pigar/issues/37)


#### Version 0.9.1 (2019.02.17)

- Fixed potential security vulnerabilities by updating requests.
- Fixed [#49](https://github.com/damnever/pigar/issues/49)


#### Version 0.9.0 (2018.08.12)

- Reuse connections.
- Update database.
- Fixed [#44](https://github.com/damnever/pigar/issues/44)


#### Version 0.7.2 (2018.04.24)

- Use https://pypi.org/
- Fixed [#41](https://github.com/damnever/pigar/issues/41)


#### Version 0.7.1 (2017.11.07)

- Fixed [#34](https://github.com/damnever/pigar/issues/34)


#### Version 0.7.0 (2017.07.03)

- Fixed the .egg suffix which caused by sudo pip install ... on Ubuntu.
- Workaround for special packages, such as [#29](https://github.com/damnever/pigar/issues/34)


#### Version 0.6.10 (2016.06.17)

- Fixed [#26](https://github.com/damnever/pigar/issues/26)
- Fixed relative import issue.


#### Version 0.6.9 (2016.05.08)

- Fixed ImportError.


#### Version 0.6.8 (2016.05.08)

- Supported flask extension.
- Sorted requirements.
- Use gevent if possible.


#### Version 0.6.7 (2015.12.13)

- If modules in the `try...except...` block, assume they are optional.


#### Version 0.6.6 (2015.11.22)

- Fixed IndexError.


#### Version 0.6.5 (2015.11.22)

- Fixed AttributeError.
- Fixed PEP8 warning.


#### Version 0.6.4 (2015.11.22)

- Removed useless code.
- Cache modules, to avoid duplication of inspection.

Thank [@spacewander](https://github.com/spacewander) for the following contributions:

- Fixed error for Python 2.7.6.
- Fixed error when using './xxx' as relative path.
- Support `importlib.import_module` and `__import__`.


#### Version 0.6.3 (2015.11.09)

- Sort files, make comments more clearer.
- Fixed grammar, to make the README clearer. Thank [@roryokane](https://github.com/roryokane) and [@flyingfisch](https://github.com/flyingfisch).
- Make it work with `python -m pigar`. Thank [@lilydjwg](https://github.com/lilydjwg).
- Fixed the pep8 warnings: [#15](https://github.com/damnever/pigar/pull/15).
- Make output more clearer: [#12](https://github.com/damnever/pigar/issues/12).
- Fixed UnicodeDecodeError for Python 3.


#### Version 0.6.2 (2015.11.05)

- If requirements file is overwritten over, show difference between old and new.
- Adjust the structure of the code.


#### Version 0.6.1 (2015.11.03)

- Fixed typo.
- Follow symlinks.


#### Version 0.6.0 (2015.10.30)

- Enhancement: issue [#7](https://github.com/damnever/pigar/issues/7), show imported module come from which files.
- Consider package installed via Git.
- Add command "-i", used to ignore a list of directory.


#### Version 0.5.5 (2015.10.21)

- Fixed issue [#2](https://github.com/damnever/pigar/issues/2) , [#3](https://github.com/damnever/pigar/issues/3) , [#4](https://github.com/damnever/pigar/issues/4) , [#5](https://github.com/damnever/pigar/issues/5).


#### Version 0.5.2-0.5.4 (2015.10.6)

- Fixed issue [#1](https://github.com/damnever/pigar/issues/1).
- Make version compare more effective.
- Removed useless code.


#### Version 0.5.1 (2015.10.01)

- Available in PyPI(https://pypi.python.org/pypi/pigar).
- Generate requirements for Python project.
- Can consider different for different Python versions.
- Search package names by imported names.
166 changes: 0 additions & 166 deletions CHANGELOG.rst

This file was deleted.

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include pigar/.db.sqlite3
include CHANGELOG.rst
include CHANGELOG.md
include README.md
include LICENSE
include makefile
Expand Down
Binary file modified pigar/.db.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion pigar/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def _comparison_operator_check(op, supported_ops=('==', '~=', '>=')):
dest='log_level',
nargs=1,
type=_log_level_check,
default=['error'],
default=['WARNING'],
help='show given level log messages, argument can be '
'(ERROR, WARNING, INFO, DEBUG), case-insensitive'
)
Expand Down
15 changes: 9 additions & 6 deletions pigar/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,12 +373,15 @@ def is_user_module(module, user_modules, package_root):
dir_path = "/"
if dir_path not in user_modules:
break
mod_path = pathlib.join(dir_path, "/".join(parts))
# FIXME(damnever): ignore the current file, but it may not be compiled?
if mod_path == cur_mod_path:
continue
if mod_path in user_modules:
return True
mod_paths = [pathlib.join(dir_path, "/".join(parts))]
if len(dir_path_parts[:i]) > 0 and dir_path_parts[:i][-1] == parts[0]:
mod_paths.append(dir_path)
for mod_path in mod_paths:
# FIXME(damnever): ignore the current file?
if mod_path == cur_mod_path:
continue
if mod_path in user_modules:
return True
return False


Expand Down
2 changes: 2 additions & 0 deletions pigar/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# (import_name, package_name)
_F_PACKAGES = {
'yaml': 'PyYAML',
'dogpile.cache': 'dogpile.cache',
'dogpile.core': 'dogpile.core',
}


Expand Down
2 changes: 1 addition & 1 deletion pigar/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def parse_file_imports(fpath, content):
parser.parse(code, fpath, lineno)
except SyntaxError as e:
# Ignore SyntaxError in Python code.
logger.debug("parse %s:%d failed: %e", fpath, lineno, e)
logger.warn("parse %s:%d failed: %r", fpath, lineno, e)
return parser.modules


Expand Down
2 changes: 1 addition & 1 deletion pigar/tests/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CmdTests(unittest.TestCase):
def setUp(self):
reqs_path = os.path.join(CUR_DIR, 'requirements.txt')
self._default_args = [
'error', False, None, [], [], reqs_path, CUR_DIR, '==', True
'WARNING', False, None, [], [], reqs_path, CUR_DIR, '==', True
]

def tearDown(self):
Expand Down
2 changes: 1 addition & 1 deletion pigar/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from __future__ import print_function, division, absolute_import

version = __version__ = '0.10.0rc0'
version = __version__ = '0.10.0'
Loading

0 comments on commit 2be65ce

Please sign in to comment.