Mypy does not ignore mpi4py module with syntax error - mypy

In mypy.ini there is
[mypy-mpi4py]
ignore_missing_imports = True
With this mypy is getting the following error
Success: no issues found in 4 source files
s\d\L\.env\lib\site-packages\mpi4py\MPI.pyi:948: error:
invalid syntax [syntax]
def __new__(cls, buf: Buffer, /) -> memory: ...
^
Found 1 error in 1 file (errors prevented further checking)
Success: no issues found in 3 source files
How can I setup the config to ignore the module ?

Related

mypy throws "error: Too many arguments for 'object'" on pre-commit hook run but not on local run

from typing import Callable, Type, TypeVar
T = TypeVar("T")
def repo(class_: Type[T]) -> Callable:
def instantiate(*args, **kwargs) -> T:
return class_(*args, **kwargs)
return instantiate
Code above throws "error: Too many arguments for 'object'" on pre-commit hook run but not on local run (python poetry run mypy repo.py).
Neither error message nor difference of behaviour between hook and local run make sense to me.
Any clue?
Thanks.
you've got a version mismatch between your two environments.
the one that is failing is mypy<=0.910:
$ mypy --version
mypy 0.910
$ mypy t.py
t.py:7: error: Too many arguments for "object"
Found 1 error in 1 file (checked 1 source file)
the one that's passing is mypy>0.910
$ mypy --version
mypy 0.971 (compiled: yes)
$ mypy t.py
Success: no issues found in 1 source file

Symfony's console PHP 7 parsing error

(Using WampServer on Windows 10.)
In some of my PHP class, I used return type declaration as explained in http://php.net/manual/en/migration70.new-features.php
Most console commands using [my-symfony-project] ... bin\console return
Parse error: syntax error, undexpected ':', expecting ';' or '{' in [file] on line [x]
Am I doing something wrong ? Or is there a solution for combining Symfony console with new PHP 7 features.
Example of function not being parsed by Symfony's console:
public function getFamilyName() : string {
return $this->familyName;
}
This error:
Parse error: syntax error, undexpected ':', expecting ';' or '{' in [file] on line [x]
means normally, that the php version is not correct.
In your case the Windows command line still runs with an old 5.* Version by default.
This can be fixed by changing the PATH variable pointing to the old php version to the new installed one.

Julia 0.4.5: libz fails to load on Ubuntu

While I was attempting to use Requests in Julia, the following error was output:
julia> using Requests
INFO: Precompiling module Requests...
ERROR: LoadError: LoadError: error compiling version: could not load library "libz"
libz: cannot open shared object file: No such file or directory
while loading /home/michael/.julia/v0.4/Libz/src/lowlevel.jl, in expression starting on line 110
while loading /home/michael/.julia/v0.4/Libz/src/Libz.jl, in expression starting on line 11
ERROR: LoadError: Failed to precompile Libz to /home/michael/.julia/lib/v0.4/Libz.ji
while loading /home/michael/.julia/v0.4/Requests/src/Requests.jl, in expression starting on line 27
ERROR: Failed to precompile Requests to /home/michael/.julia/lib/v0.4/Requests.ji
in compilecache at ./loading.jl:400
I'm not knowledgeable enough in Julia to discern exactly what is happening, but here is the code from Libz.jl (line 11)...
include("lowlevel.jl")
...from lowlevel.jl (lines 103-110)...
# Functions
# ---------
function version()
return unsafe_string(ccall((:zlibVersion, zlib), Ptr{UInt8}, ()))
end
const zlib_version = version()
...and from Requests.jl (line 27)
using Libz
This problem has persisted after I've removed then reinstalled Libz, MbedTLS, and Requests, and after I've Pkg.update()'ed and restarted julia and my computer. Is anyone well enough versed in Julia to know how to fix this?
Per the comment by Gnimuc K and a tiny bit more research:
sudo apt-get install zlib1g-dev
installs zlib, which Julia needed. Once it was installed...
julia> Pkg.update()
julia> Pkg.build("Libz")
worked all the kinks out.

Getting "org.scala-sbt#sbt;0.13.8: not found" error though I have the same version installed in my system.How to resolve this?

set -e pipefail; sbt -Dsbt.log.noformat=true -DchiselVersion="latest.release" "run Parity --genHarness --compile --test --backend c --vcd " | tee Parity.out
Getting org.scala-sbt sbt 0.13.8 ...
problems summary ::
WARNINGS
module not found: org.scala-sbt#sbt;0.13.8
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-sbt#sbt;0.13.8: not found
::::::::::::::::::::::::::::::::::::::::::::::
ERRORS
Server access Error: Connection refused url=https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.8/ivys/ivy.xml
Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.pom
Server access Error: Connection refused url=https://repo1.maven.org/maven2/org/scala-sbt/sbt/0.13.8/sbt-0.13.8.jar
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.13.8: not found
Error during sbt execution: Error retrieving required libraries
Error: Could not retrieve sbt 0.13.8
this might be proxy issue.
Edit $SBT_HOME/conf directory/sbtconfig.txt file and add following entries:
-Dhttp.proxyHost=<proxy server>
-Dhttp.proxyPort=<proxy port>
-Dhttp.proxyUser=<username>
-Dhttp.proxyPassword=<password>
-Dhttps.proxyHost=<proxy server>
-Dhttps.proxyPort=<proxy port>
-Dhttps.proxyUser=<username>
-Dhttps.proxyPassword=<password>
-Dftp.proxyHost=<proxy server>
-Dftp.proxyPort=<proxy port>
-Dftp.proxyUser=<username>
-Dftp.proxyPassword=<password>
Notes:
https settings are necessary as many urls referred by the SBT are https based.
Don't include "http://" in the value
I faced a similar issue. Seems like the issue is with the java that is used. By mistake my environment was pointing to jre rather than jdk. After pointing to right JAVA_HOME as below, the sbt clean package compile worked fine.
[root#spark-sql-perf]# update-alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
*+ 1 java-1.8.0-openjdk.ppc64le (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.ppc64le/jre/bin/java)
2 java-1.7.0-openjdk.ppc64le (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.121-2.6.8.0.el7_3.ppc64le/jre/bin/java)
Enter to keep the current selection[+], or type selection number: q
There are 2 programs which provide 'java'.
Selection Command
*+ 1 java-1.8.0-openjdk.ppc64le (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.ppc64le/jre/bin/java)
2 java-1.7.0-openjdk.ppc64le (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.121-2.6.8.0.el7_3.ppc64le/jre/bin/java)
Enter to keep the current selection[+], or type selection number: ^C
[root#spark-sql-perf]# export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-2.b15.el7_3.ppc64le/
[root#spark-sql-perf]# export PATH=$JAVA_HOME/bin:$PATH

grunt Error: Cannot find module 'imagemin-pngquant'

I'm trying to run grunt command but when i do, this error shows up:
MacBook-Pro-de-Paulo:homedesigners PauloDuarte$ grunt
Loading "imagemin.js" tasks...ERROR
Error: Cannot find module 'imagemin-pngquant'
Running "jshint:all" (jshint) task
public/modules/landing/directives/scrollOnClick.client.directive.js
13 | $target = $(idToScroll);
^ '$' is not defined.
17 | $('body').animate({scrollTop: $target.offset().top});
^ '$' is not defined.
2 errors in 55 files
Fatal error: Invalid URI ""
MacBook-Pro-de-Paulo:homedesigners PauloDuarte$
Anyone can help? thanks
You can try installing the required module using npm:
npm install imagemin-pngquant

Resources