cokelaer / easydev Goto Github PK
View Code? Open in Web Editor NEWCommon utilities to ease the development of Python packages
Home Page: http://easydev-python.readthedocs.io/
License: Other
Common utilities to ease the development of Python packages
Home Page: http://easydev-python.readthedocs.io/
License: Other
AttrDict is useful to acecss quickly to dictionary attributes.
The recursive implementation could be handy for json format
Project license is identified as BSD-3-Clause in both https://github.com/cokelaer/easydev/blob/master/COPYING and https://github.com/cokelaer/easydev/blob/master/setup.py, but the license headers in most source code files still explicitly mention GPL-3.0, e.g. https://github.com/cokelaer/easydev/blob/master/easydev/__init__.py#L10. Can you please clarify whether those GPL-3.0 licensing statements are still valid, or whether they should be fixed to reflect the actual license?
easydev should be pure python, there is no plot directive used so we can remove that dependency.
Would you please consider to make mock usage optional in favour of unittest.mock as in test_browse.py?
Because in the manifest.in there is line recursive-include easydev/share *
it will include the pycache folder too.
Linters found it when I packaged it from openSUSE:
[ 8s] python2-easydev.noarch: W: python-bytecode-wrong-magic-value /usr/lib/python2.7/site-packages/easydev/share/__pycache__/__init__.cpython-35.pyc expected 62211 (2.7), found 3350 (3.5)
[ 8s] python3-easydev.noarch: W: python-bytecode-wrong-magic-value /usr/lib/python3.7/site-packages/easydev/share/__pycache__/__init__.cpython-35.pyc expected 3390 or 3391 or 3392 or 3393 or 3394 (3.7), found 3350 (3.5)
This happen in version 0.9.10 when colorama was used to provide colors in the text printing.
Under unix and max it seems to work well. In the console module, we do
import colorama
colorama.init()
And that's when it broke. So, we will probably remove colorama and find another solution. Sphinx or snakemake seems to do a good job.
According to https://github.com/ActiveState/appdirs/blob/master/README.rst , the appdirs project is now dead upstream. Even though easydev will not be immediately affected due to embedding appdirs source code, it might not be a good idea to use this dead project in the long term. The appdirs upstream recommends migrating to using platformdirs
( https://pypi.org/project/platformdirs/ ) instead.
It seems when you import the latest bioservices, I get the following error.
AttributeError Traceback (most recent call last)
/var/folders/51/0w_3wxsx13s1kzbm_btb5bbw0000gn/T/ipykernel_79890/3845901339.py in <module>
----> 1 biomodels = BioModels()
~/.venv/lib/python3.9/site-packages/bioservices/biomodels.py in __init__(self, verbose)
99
100 """
--> 101 super(BioModels, self).__init__(name="BioModels", url=BioModels._url,
102 verbose=verbose)
103 def _check_format(self, frmt, supported=['json', 'xml', 'html']):
~/.venv/lib/python3.9/site-packages/bioservices/services.py in __init__(self, name, url, verbose, cache, requests_per_sec, proxies, cert, url_defined_later)
455 def __init__(self, name, url=None, verbose=True, cache=False,
456 requests_per_sec=3, proxies=[], cert=None, url_defined_later=False):
--> 457 super(REST, self).__init__(name, url, verbose=verbose,
458 requests_per_sec=requests_per_sec,
459 url_defined_later=url_defined_later)
~/.venv/lib/python3.9/site-packages/bioservices/services.py in __init__(self, name, url, verbose, requests_per_sec, url_defined_later)
340 def __init__(self, name, url=None, verbose=True, requests_per_sec=3,
341 url_defined_later=False):
--> 342 super(RESTbase, self).__init__(name, url, verbose=verbose,
343 requests_per_sec=requests_per_sec,
344 url_defined_later=url_defined_later)
~/.venv/lib/python3.9/site-packages/bioservices/services.py in __init__(self, name, url, verbose, requests_per_sec, url_defined_later)
120 self.requests_per_sec = requests_per_sec
121 self.name = name
--> 122 self.logging = Logging("bioservices:%s" % self.name, verbose)
123
124 self._url = url
~/.venv/lib/python3.9/site-packages/easydev/logging_tools.py in __init__(self, name, level, text_color)
51 style='%'
52 )
---> 53 self._set_name(name)
54
55 logger = colorlog.getLogger(self._name)
~/.venv/lib/python3.9/site-packages/easydev/logging_tools.py in _set_name(self, name)
63 logger = colorlog.getLogger(self._name)
64 if level == 0:
---> 65 self._set_level("WARNING")
66 else:
67 self._set_level(level)
~/.venv/lib/python3.9/site-packages/easydev/logging_tools.py in _set_level(self, level)
86 if level == 50:
87 level = "CRITICAL"
---> 88 logging_level = getattr(colorlog.logging.logging, level)
89 colorlog.getLogger(self.name).setLevel(level)
90
AttributeError: module 'colorlog' has no attribute 'logging'
should check content of get_ipython() method if it exists
I just found Bioservices a few weeks ago and I think it is a great project. Thanks for all your work.
I started using bioservices.eutils in a project and noticed that as soon as I instantiate EUtils I no longer get any debug messages from any loggers in my project. It looks like the Logging class from easydev is deleting the logging configuration my script established.
I think lines 72 and 73 in logging_tools.py are the problem. It would be helpful if this behavior were optional.
with mock.patch("sys.platform", "darwin"):
> from easydev import appdirs
E ImportError: cannot import name 'appdirs' from 'easydev' (/home/tchet/deb/python-easydev/.pybuild/cpython3_3.11_easydev/build/easydev/__init__.py)
test/test_appdirs.py:14: ImportError
______________________________ test_config_custom ______________________________
def test_config_custom():
> c = CustomConfig("dummy")
test/test_config.py:10:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <easydev.config_tools.CustomConfig object at 0x7fa0a8961bd0>
name = 'dummy', verbose = False
def __init__(self, name, verbose=False):
self.verbose = verbose
> from easydev import appdirs
E ImportError: cannot import name 'appdirs' from 'easydev' (/home/tchet/deb/python-easydev/.pybuild/cpython3_3.11_easydev/build/easydev/__init__.py)
easydev/config_tools.py:324: ImportError
=========================== short test summary info ============================
FAILED test/test_appdirs.py::test_app - ImportError: cannot import name 'appd...
FAILED test/test_config.py::test_config_custom - ImportError: cannot import n...
========================= 2 failed, 55 passed in 4.44s =========================
There is a return carriage added in the shell. This works as expected in ipython notebook or within an ipython notebook but not in a shell.
fetch it on http://pythonhosted.org/browse/
The multicore uses a Pool method. One major issue is that it does not allows keyboard interruption. It seems to be inherent to how the join() method of the multiprocessing (Python) module handles KeyboardInterrupt exception.
After some searches, the solution is to initialise the Pool with a init_worker
def init_worker():
import signal
signal.signal(signal.SIGINT, signal.SIG_IGN)
easydev '0.9.36' has been installed but version is stuck to '0.9.34'
Python 3.6.3 (default, Jan 9 2018, 19:10:54)
[GCC 5.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import easydev
>>> easydev.__path__
['/tmp/bioconvert/lib64/python3.6/site-packages/easydev']
>>> easydev.__version__
'0.9.34'
>>>
(bioconvert) bneron@musky:~$pip show easydev
Name: easydev
Version: 0.9.36
Here is a possible API
install_github(repo)
install_github([repo, repo2])
install_github(repo, repo2)
install_github(path=where_to_put, auth_token="abc")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.