text:
client_secret_post is supported but doesn't work.

Describe the bug
According to http://auth-server:9000/.well-known/openid-configuration, both client_secret_basic and client_secret_post should be supported, however client_secret_post doesnt seem to work.
token_endpoint_auth_methods_supported: [
"client_secret_basic",
"client_secret_post"
],

To Reproduce
Run the sample authorization server. Execute the following:
curl -v -k --request POST \
  --url 'http://auth-server:9000/oauth2/token' \
  --header 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
  --data 'grant_type=client_credentials' \
  --data 'scope=message.read message.write' \
  --data 'client_id=messaging-client' \
  --data 'client_secret=secret'

The server responds with 401 {"error":"invalid_client"}
Expected behavior
I would expect to get a token response just like the client_secret_basic method which can be invoked as following:
curl --user messaging-client:secret -v -k --request POST \
  --url 'http://auth-server:9000/oauth2/token' \
  --header 'content-type: application/x-www-form-urlencoded;charset=UTF-8' \
  --data 'grant_type=client_credentials' \
  --data 'scope=message.read message.write'

In this case the server responds with 200 and {"access_token":"eyJraetcetcetcetcetc"}
Sample
The spring-authorization-server sample can be used to reproduce.
https://github.com/spring-projects-experimental/spring-authorization-server/tree/main/samples/boot/oauth2-integration/authorizationserver

@gvermoen The messaging-client in the sample is configured only with ClientAuthenticationMethod.BASIC by default. You would need to edit the AuthorizationServerConfig and add ClientAuthenticationMethod.POST to the messaging-client registration.

Hi @anoopgarlapati you're absolutely correct! Thanks

authors: anoopgarlapati gvermoen


text:
Perform AOT processing for autowired fields and setters

AutowiredAnnotationBeanPostProcessor was disabled via https://github.com/spring-projects-experimental/spring-native/commit/16b62d5652ff508d8378d2671c875653d32bccd2 because it was using reflection on all the autoconfigurations which defeats the purpose of this branch in term of efficiency.
After discussion with @bclozel and @jhoeller, it seems we'd have to perform the scanning part at AOT level, and generate the code that will perform the injection at runtime.
For autowired fields and setters, we could bake similar code into the bean definition. Once we provide an instance supplier there, that supplier implementation could not only construct the object but also populate pre-detected fields/setters with AutowireCapableBeanFactory.resolveDependency  calls (or whatever else we do for autowired constructor arguments, it's fundamentally the same resolution algorithm).

I tried to migrate the webclient sample but it fails due to no static resources serving because, as expected, this injection does not happen.

I am making some progress with method-level injection:
context.registerBean("testComponent", TestComponent.class, () -> {
	TestComponent bean = new TestComponent();
	InjectionElementAttributes attributes = InjectionMethodMetadata.ofBean("testComponent", TestComponent.class)
			.forMethod("injectBean", String.class).resolve(context);
	attributes.ifResolved(() -> bean.injectBean(attributes.get(0)));
	return bean;
});

It's worth trying the WebSample again once this work is merged in 0.11.x as we generate the following now:
BeanDefinitionRegistrar.of("org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration", WebMvcAutoConfiguration.EnableWebMvcConfiguration.class).instanceSupplier((instanceContext) -> {
  WebMvcAutoConfiguration.EnableWebMvcConfiguration bean = new WebMvcAutoConfiguration.EnableWebMvcConfiguration(context.getBean(ResourceProperties.class), context.getBean(WebMvcProperties.class), context.getBean(WebProperties.class), context.getBeanProvider(WebMvcRegistrations.class), context.getBeanProvider(WebMvcAutoConfiguration.ResourceHandlerRegistrationCustomizer.class), context);
  instanceContext.method("setConfigurers", List.class)
		  .resolve(context, false).ifResolved((attributes) -> {
	  List<WebMvcConfigurer> attributes0 = attributes.get(0);
	  bean.setConfigurers(attributes0);
  });
  return bean;
}).register(context);

With the help of @bclozel we now have the specific reflection entries that we need to call autowired setters and fields. The webclient sample now fails with:
Caused by: java.lang.IllegalStateException: /org/springframework/http/mime.types not found in classpath
	at org.springframework.util.Assert.state(Assert.java:76) ~[na:na]
	at org.springframework.http.MediaTypeFactory.parseMimeTypes(MediaTypeFactory.java:69) ~[na:na]
	at org.springframework.http.MediaTypeFactory.<clinit>(MediaTypeFactory.java:48) ~[na:na]
	at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375) ~[na:na]
	at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295) ~[na:na]
	... 71 common frames omitted

Closed by 0a04f4ea9033

source: gharchive/issue

authors: sdeleuze snicoll

license_type: permissive

license_source: github-api


text:
The metadata of the file created by the TextSplitter class (doSplitDocuments method) is getting the incorrect page number

After running this sample application (ai-openai-rag) I noticed that there are 12 entries in the vector_store table, but the page_number field (in the metadata column) for all the entries is shown as 10.
`vector_store=# select metadata from vector_store;
metadata
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
{"file_name": "/target/classes/data/medicaid-wa-faqs.pdf", "page_number": 10}
(12 rows)`
Looks like the doSplitDocuments method in the TextSplitter class is generating this incorrect page_number for all the documents.

+1

Seems fixed by https://github.com/spring-projects/spring-ai/commit/6753e242e8f9fa5dfc8ee239ba2add6c1c2b6855 so can we close this issue?
https://github.com/spring-projects/spring-ai/pull/934 -> Enhance test about incorrect page number case

#934 is adding a test, and not changing any code.  The test is creating the metadata with the page_number explicitly and validating that it worked as expected.  What is reported in this issue looks to be a bug in PagePdfDocumentReader, so this issue should remain open.  Also, that sample app needs to be updated, I'll fix that.

authors: iAMSagar44 injae-kim markpollack yucaowang

repo: spring-projects/spring-ai


text:
when using save(iterable) to save a collection of detached object, it will find one every times, instead of findByIds [DATAJDBC-631]

hackingwu opened DATAJDBC-631 and commented
@Transactional
public <S extends T> List<S> save(Iterable<S> entities) {

 List<S> result = new ArrayList<S>();

 if (entities == null) {
 return result;
 }

 for (S entity : entities) {
 result.add(save(entity));
 }

 return result;
}

if entities is a collection of detached object, it will load object once by once, why not check all entities status first , add id of detached object to list. using byIds to load detached object to persistent context together, maybe it will improve performance when save a collection of detached object

Issue Links:

DATAJDBC-210 Improve strategy for persisting referenced entities
("depends on")

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Just noticed you said this is about Spring Data JPA. There it doesn't matter, since JPA caches writes anyway.

Just noticed you said this is about Spring Data JPA. There it doesn't matter, since JPA caches writes anyway.

authors: schauder spring-issuemaster

repo: spring-projects/spring-data-jdbc


text:
Bug? Repository Batch Insert on BigDecimal not working

Hi I have questions about the saveAll dealing of an entity with the BigDecimal and BigInteger fields.
@Entity
@Data
@IdClass(PTSTemplateEntityPK.class)
@Table(name = "test")
public class TestEntity implements Serializable {
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(name = "dpstId")
  private int dpstId;

  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  @Column(name = "arstId")
//  @GeneratedValue(strategy = GenerationType.AUTO)
  private int arstId;

  private BigDecimal name;

  private BigDecimal location;

}

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import com.example.demo.domain.PTSTemplateEntityPK;
import com.example.demo.domain.TestEntity;

@Repository
public interface TestRepository extends JpaRepository<TestEntity, PTSTemplateEntityPK> {
}

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.domain.TestEntity;
import com.example.demo.repository.TestRepository;

@RestController
@RequestMapping(value = "/test")
public class TestController {
  private TestRepository testRepository;

  private static List<TestEntity> testEntities = new ArrayList<>();

  static {
    for (int i = 0; i < 2; i++) {
      TestEntity testEntity = new TestEntity();

      testEntity.setLocation(new BigDecimal(i));
      testEntities.add(testEntity);
    }
  }

  public TestController(TestRepository testRepository) {
    this.testRepository = testRepository;
  }

  @GetMapping
  public ResponseEntity<List<TestEntity>> insertData() {
    testRepository.saveAll(testEntities);
    List<TestEntity> all = testRepository.findAll();
    return ResponseEntity.ok().body(all);
  }
}

import java.io.Serializable;

import javax.persistence.Column;

import lombok.Data;

@Data
public class PTSTemplateEntityPK implements Serializable {

  @Column(name = "arstId")
  private int arstId;

  @Column(name = "dpstId")
  private int dpstId;
}

Here I save two items using saveAll to the postgres 14 database using spring-data-jpa-2.7.3 (Java 11).
As you tell I am expecting all 2 items would be saved to the database, but I can see one is saved. If I change the BigDecimal fields to other types like integer/ string, I can see the data insertion is normal.
So my questions are:

Is Batch Insert on BigDecimal/ BigInteger type supported?
If it is not supported, what is the recommended way to insert entities with these data types?

Hi @Isaacwhyuenac,
I have a few questions regarding the posted issue:

When you specify If I change the BigDecimal fields to other types like integer/ string, I can see the data insertion is normal - are you changing the data type for PK attribute inside PTSTemplateEntityPK.java or data types of name and location attributes in TestEntity.java?
Can you please share the code for PTSTemplateEntityPK.java which is responsible for generating the ID?

Hi @hariohmprasath.

I mean I changed name and location fields from BigDecimal to string/int. SaveAll can save whatsoever the number of items I provided to it.
PTSTemplateEntityPK.java Here you are

import java.io.Serializable;

import javax.persistence.Column;

import lombok.Data;

@Data
public class PTSTemplateEntityPK implements Serializable {

  @Column(name = "arstId")
  private int arstId;

  @Column(name = "dpstId")
  private int dpstId;
}

Hi @Isaacwhyuenac,
Thanks for the sample, looks like you have configured the CompositeKey class wrongly which leads to this behavior. You dont need to specify @Column again part of PTSTemplateEntityPK.java. Here is the updated code and I can see two records created in database:
@Data
public class PTSTemplateEntityPK implements Serializable {
	private int arstId;
	private int dpstId;
}

Response
// 20221003235905
// http://localhost:8080/test

[
  {
    "dpstId": 2,
    "arstId": 1,
    "name": null,
    "location": 0
  },
  {
    "dpstId": 4,
    "arstId": 3,
    "name": null,
    "location": 1
  }
]

Hi @hariohmprasath
Thanks for your response. But I still cannot replicate what you are doing. I saw in your response json location and name fields are not decimal. It is because you have changed them to other types?? Here is what I am having
// 20221004151156
// http://localhost:8088/test
[
{
"dpstId": 0,
"arstId": 0,
"name": null,
"location": 2.00
}
]
Besides, I have committed a testing repo here https://github.com/Isaacwhyuenac/spring-data-jpa-tester.

@Isaacwhyuenac You are using Spring Data JPA not Spring Data JDBC or R2DBC. And you even created the issue in the correct GitHub repo: https://github.com/spring-projects/spring-data-jpa/issues/2656
Closing this one here.

authors: Isaacwhyuenac hariohmprasath schauder

repo: spring-projects/spring-data-relational


text:
An empty List in the variable input is converted to null

We have an input type that has a list of Int:
input AnInput {
id: ID!
aList: [Int]
}
The variables that are passed look like this:
{
"id": "3a9b3c5b-be6b-4f6a-bf0d-067681bb950c",
"aList": []
}
The value of aList in our handler is null when we are expecting an empty list.  I would expect a null value if it was set to null in the variables:
{
"id": "3a9b3c5b-be6b-4f6a-bf0d-067681bb950c",
"aList": null
}
Or if the value was not present in the variables:
{
"id": "3a9b3c5b-be6b-4f6a-bf0d-067681bb950c"
}
It looks like the code in GraphQlArgumentInitializer.visitArgumentMap() does not handle the empty list correctly.

@wjohnstonjr Sound like same problem #301

Yup, looks just like it.

@wjohnstonjr if you can, please give the snapshot a try.

I tried the snapshot and I get this error:
`***************************
APPLICATION FAILED TO START

Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.graphql.boot.GraphQlWebMvcAutoConfiguration.graphQlRouterFunction(GraphQlWebMvcAutoConfiguration.java:120)

The following method did not exist:
org/springframework/graphql/web/webmvc/GraphiQlHandler.<init>(Ljava/lang/String;)V

The method's class, org.springframework.graphql.web.webmvc.GraphiQlHandler, is available from the following locations:
jar:file:/C:/repository/org/springframework/graphql/spring-graphql/1.0.0-SNAPSHOT/spring-graphql-1.0.0-SNAPSHOT.jar!/org/springframework/graphql/web/webmvc/GraphiQlHandler.class

The class hierarchy was loaded from the following locations:
org.springframework.graphql.web.webmvc.GraphiQlHandler: file:/C:/repository/org/springframework/graphql/spring-graphql/1.0.0-SNAPSHOT/spring-graphql-1.0.0-SNAPSHOT.jar

Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.graphql.web.webmvc.GraphiQlHandler
`

@rstoyanchev, I got past the error by setting spring.graphql.graphiql.enabled=false.  Is this a known issue?
I tested it and it is working.  I get the empty List when I passed [].

@wjohnstonjr are you using the latest 2.7.0-SNAPSHOT Spring Boot version?

@bclozel, I am not using 2.7.0-SNAPSHOT and I do not have access to the snapshot or milestone repositories at work.  I put in a request to get access to them but it will probably take some time.  Will this fix only be in the 2.7.0 releases?

I don't understand. How are you using Spring GraphQL if you don't have access to milestones nor snapshots? There is no GA version yet.
From a Spring Boot auto-configuration perspective, you should now use the official Spring Boot starter for Spring GraphQL, as the former experimental one is now defunct.

I manually downloaded the 1.0.0-M4 versions and added them to our local Artifactory.

I was able to test with 2.7.0-SNAPSHOT and it is working.

authors: bclozel dugenkui03 rstoyanchev wjohnstonjr

repo: spring-projects/spring-graphql


text:
Docs say defaultRetryTopicKafkaTemplate is the default template bean name. @RetryableTopic javadoc says retryTopicDefaultKafkaTemplate

Backport of gh-3514

Fixed via 8ecb85e5fd228cef4d1ad022bd88cadd3b628690

repo: spring-projects/spring-kafka


text:
Fix for losing authentication details on token refresh

This fix is for the case when user implements custom
AccessTokenConverter that puts extra information into the token in
convertAccessToken and extracts it into Authentication inside
extractAuthentication.
Those details were lost on the refresh token code path.
The fix makes DefaultTokenServices to preserve the details much
like it is already doing so when user has supplied custom
AuthenticationManager.
The fix also changes createRefreshedAuthentication access level to
protected so that user can modify scope narrowing logic. That is
to conform to the access level of other similar methods, such as
isExpired.

Thanks. Did you fill out the contributor's agreement (link in README)?

I have signed it. Confirmation number: 148220151114050657

@voronaam I'm going to close this PR in favour of #823 as per your comment.

source: gharchive/pull-request

authors: dsyer jgrandja voronaam

repo: spring-projects/spring-security-oauth

license_source: bigquery


text:
Swagger ui dose not work when @RequestParam annotation dose not set to method parameter

i asked a question in stackoverflow and gitter and Dilip Krishnan  suggest to create issue in github for request new feature
this is my question [ http://stackoverflow.com/questions/38284796/swagger-ui-dose-not-work-when-requestparam-annotation-dose-not-set-to-method-pa]

Thank you for submitting this issue. 👍

This has been fixed via #1444

authors: azizkhani dilipkrish

repo: springfox/springfox


text:
Can't declare Docket in multiple Configuration classes

Hi,
we're trying to figure out if it's possibile to declare Docket beans in @Configuration classes different from the "main" one. The scenario is the following: we have a multi-module application and each module should define its Controllers. A common module is defining the SpringFox configuration:
@Configuration
@EnableSwagger
public class SpringFoxConfig {

    @Bean
    public Docket allApisDocket() {
       // ...
    }

}

This configuration scans all the controller of the context and returns the json docs for all the APIs.
Now we'd like that each module could define a Docket with a specific groupName (which is basically a partial view of the APIs). In another configuration class (loaded via @ComponentScan in the same context) we've put
@Configuration
public class ModuleXConfig {

   public Docker moduleXDocket() {
       return new Docket(DocumentationType.SWAGGER_2)
                 /* ... */
                 .groupName("moduleX");
   }

}

Unfortunately this is not working; if we move the moduleXDocket to the SpringFoxConfig then everything is fine.
We did a couple of tests, without luck:

Use @EnableSwagger2 in the second configuration
Load the second configuration via @ComponentScan from SpringFoxConfig

We're not using Spring Boot; spring-mvc is at version 4.3.9 and we're stuck with SpringFox version 2.2.2 (our application must be compatibile with JEE6 specs, our understanding is that newer version depends on servlet-api 3.1 => JEE7).
Are we missing something? Is it a bug? Is this an unsupported feature?
Thank you,
lorenzo

Firstly you should upgrade to springfox 2.7.0 while it uses a provided dependency of servlet api 3.1 it can run under a 2.5 spec compliant container.
Frankly I haven't tried importing dockets from modules. Are you explicitly importing your ModuleXConfiguration or are you component scanning it. It might be a timing issue.

Thank you (and please excuse me for the late replay). I'll try to upgrade to v2.7.0 as soon as I can. Regarding my tests I tried to include the dockets both importing the configuration and using component scan, with no success.
Thank you,
lorenzo

@lorenzobenvenuti great! let me know what you find with 2.7.0

I have exactly the same situation. I am using springfox-2.7.0 and I have tried the pretty much the same steps before stumbling on this page. No success so far, only the second config

Use @EnableSwagger2 in the second configuration
Extend the second configuration from the first
Declare the Bean Order(1) in the second configuration.

@lorenzobenvenuti  Have you managed to get it running.
@dilipkrish any help is much appreciated.
Cheers

Hi @vijaykalidindi, I'm sorry but I didn't investigate further.
lorenzo

I'll investigate thanks for reporting @vijaykalidindi

I am using version 2.9.2 and I seem to be having the exact same issue. From reading the above, I'm not sure if this is supposed to be fixed? Or was it working all along if done right? If so, what do I need to do in order to define Dockets in different classes?

authors: cgraefe dilipkrish lorenzobenvenuti vijaykalidindi


text:
NumberFormatException when parsing node name from Forward header with double quotes

I have an api gateway built with Spring Cloud Gateway (Finchley.M9) and when I try to hit the api to get the JSON for the documentation, swagger cant parse the "forwarded" header when the node "host" and "for" are double quoted because of the port number being added. I spoke with the developer of Spring Cloud Gateway
@spencerbgibb hey Spencer, ForwardedHeadersFilter is including extra quotes in some of the fields. Is this according to the specs? It breaks on my downstream system. Thank you pic.twitter.com/Q0TO6aNE5L— Thiago Locatelli (@thiagolocatelli) March 23, 2018
and he mentioned that according to the specs, when there is a colon, it needs to be double quoted.
Header: forward
Value: proto=http; host="127.0.0.1:8081"; for="127.0.0.1:50518"
Headers being sent to the docs api:

Specs: https://tools.ietf.org/html/rfc7239, end of page 7: It is important to note that an IPv6 address and any node name with node-port specified MUST be quoted, since ":" is not an allowed character in "token".
Swagger version: 2.4.0
Stacktrace:

java.lang.NumberFormatException: For input string: "8081""
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.parseInt(Integer.java:615)
	at springfox.documentation.swagger2.web.HostNameProvider.componentsFrom(HostNameProvider.java:62)
	at springfox.documentation.swagger2.web.Swagger2Controller.hostName(Swagger2Controller.java:90)
	at springfox.documentation.swagger2.web.Swagger2Controller.getDocumentation(Swagger2Controller.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:220)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:134)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:105)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:107)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

I have updated my question with the stacktrace and the swagger version.

@thiagolocatelli I just realized this is based on v2.4.0. Could you please try with 2.8.0 and report back

authors: dilipkrish thiagolocatelli


text:
empty properties in model where @JsonProperty exists in @JsonCreator static factory method.

As described in #586, after more tests(tested on 1.0.2 release), I found this only occurs on the static factory @JsonCreator method.
For example, this is my API contorller method.
@RequestMapping(value = "/test-api", method = RequestMethod.POST)
public TestDto testApi(@RequestBody TestApiRequest request){
   ...
}

And here is the class definition of TestApiRequest
package com.kkbox.espresso.model.account;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.annotation.Nullable;

public class TestApiRequest{

  private String name;
  private String email;

  public TestApiRequest(String name,String email){
    this.name = name;
    this.email = email;
  }

  @JsonCreator
  public static TestApiRequest create(@JsonProperty("name") String name, @JsonProperty("email") String email){
    return new TestApiRequest(name, email);
  }

  @JsonProperty
  @Nullable
  public String getName(){
    return this.name;
  };

  @JsonProperty
  @Nullable
  public String getEmail() {
    return this.email;
  }
}

Note that the "create" static factory method, putting @JsonPropery annotation onto the parameters causes this empty model properties.

@masonhsiung unfortunately if its not working in 1.0.2 we're not going to fix it unless it is critical (which this is not). This issue has been fixed in 2.0

authors: dilipkrish masonhsiung


text:
TE-8816: Check fronted tools for new Backoffice

PR Description
Ticket: https://spryker.atlassian.net/browse/TE-8816
For https://github.com/spryker/suite-nonsplit/pull/5465

FYI: I fixed up the missing labels via tooling.

authors: dereuromark zamlely

repo: spryker/oryx-for-zed

license: MIT


text:
Pylint remaining source code

Follow-up to #4731

Codecov Report

Merging #4760 (99b5ef0) into master (63d1c09) will increase coverage by 0.01%.
The diff coverage is 92.43%.

@@            Coverage Diff             @@
##           master    #4760      +/-   ##
==========================================
+ Coverage   95.35%   95.36%   +0.01%
==========================================
  Files         570      570
  Lines       61136    61126      -10
==========================================
- Hits        58298    58295       -3
+ Misses       2838     2831       -7

Flag
Coverage Δ

servertests
47.44% <30.27%> (+<0.01%)
:arrow_up:

test_responses
33.03% <15.13%> (+<0.01%)
:arrow_up:

unittests
95.25% <92.20%> (+0.01%)
:arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files
Coverage Δ

moto/opsworks/responses.py
100.00% <ø> (ø)

moto/rds/exceptions.py
72.22% <0.00%> (ø)

moto/swf/responses.py
92.78% <ø> (ø)

moto/stepfunctions/exceptions.py
96.55% <50.00%> (ø)

moto/iotdata/exceptions.py
86.66% <66.66%> (ø)

moto/iot/exceptions.py
89.74% <75.00%> (ø)

moto/ses/exceptions.py
94.33% <76.92%> (ø)

moto/s3/exceptions.py
93.92% <78.43%> (ø)

moto/redshift/exceptions.py
93.93% <78.94%> (ø)

moto/sagemaker/exceptions.py
87.50% <80.00%> (ø)

... and 75 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63d1c09...99b5ef0. Read the comment docs.

authors: bblommers codecov-commenter

repo: spulec/moto


text:
Autoformat uses black instead of autopep8, even if autopep8 is selected.

Issue Report Checklist

[X] Searched the issues page for similar reports
[X] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
[X] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
[X] Could not reproduce inside jupyter qtconsole (if console-related)
[X] Tried basic troubleshooting (if a bug/error)

[X] Restarted Spyder
[X] Reset preferences with spyder --reset
[no] Reinstalled the latest version of Anaconda
[X] Tried the other applicable steps from the Troubleshooting Guide

[X] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description
Autoformat uses black instead of autopep8, even if autopep8 is selected.
What steps reproduce the problem?

Select some text
Source -> Format file or selection using autopep8

What is the expected output? What do you see instead?
For the following code, which is pep8 compliant, I would expect no change:
def get_impulse(
        participant: str,
        session: str,
        trial: str,
        push: int) -> float:
    """Return the impulses on the specific push."""
    for signal in [
        'Ftot', 'Ftan', 'Frad', 'Fmed', 'Mprop',
        'Anterior', 'Superior', 'Lateral',
        'Flexion', 'Adduction', 'InternalRotation',
    ]:
        pass

instead, the code is formatted to:
def get_impulse(participant: str, session: str, trial: str, push: int) -> float:
    """Return the impulses on the specific push."""
    for signal in [
        "Ftot",
        "Ftan",
        "Frad",
        "Fmed",
        "Mprop",
        "Anterior",
        "Superior",
        "Lateral",
        "Flexion",
        "Adduction",
        "InternalRotation",
    ]:
        pass

which is black format.
Versions

Spyder version: 5.1.5
Python version: 3.8.10
Qt version: 5.12.9
PyQt version: 5.12.13
Operating System name/version: macOS Catalina

Dependencies

Mandatory:
applaunchservices >=0.1.7     :  0.2.1 (OK)
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.6.0               :  8.1.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jsonschema >=3.2.0            :  4.4.0 (OK)
keyring >=17.0.0              :  23.4.0 (OK)
nbconvert >=4.0               :  6.4.4 (OK)
numpydoc >=0.6.0              :  1.2 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0;<2.10.0        :  2.7.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.2.2;<1.3.0          :  1.2.4 (OK)
pylsp_black >=1.0.0           :  None (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.1.0             :  5.1.1 (OK)
qtpy >=1.5.0                  :  2.0.1 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  60.10.0 (OK)
sphinx >=0.6.6                :  4.4.0 (OK)
spyder_kernels >=2.1.1;<2.2.0 :  2.1.3 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  None (OK)
matplotlib >=2.0.0            :  3.5.1 (OK)
numpy >=1.7                   :  1.22.3 (OK)
pandas >=1.1.1                :  1.4.1 (OK)
scipy >=0.17.0                :  1.8.0 (OK)
sympy >=0.7.3                 :  None (OK)

When I put your example in the Black Playground with the default settings I get the same formatting transformation you see. Is it perhaps expected behaviour of black?

Hey @felixchenier, thanks for reporting. This error is already fixed in our latest version (5.2.2).
Since it's still not available in Anaconda, you have two options:

Use our Windows installer, which you can find here.

Create a new environment with conda-forge packages. For that, please close Spyder, open the Anaconda Prompt and run the following commands there:
 conda create -n spyder-cf -c conda-forge spyder
 conda activate spyder-cf
 spyder

After that, you can connect Spyder to your base environment by following these instructions:
http://docs.spyder-ide.org/current/faq.html#using-existing-environment

Thank you @ccordoba12 for your detailed answer and commitment. It worked perfectly.

Great! I'm glad it worked for you.

authors: ba-tno ccordoba12 felixchenier

repo: spyder-ide/spyder


text:
Please Help

What steps will reproduce the problem?

import time
pin = str(input("Enter a pin: "))
ftime = time.time()
testpin = "0000"
for _ in range(9999):
testpin = str(testpin)
testpin.ljust(4,"0")
if testpin == pin:
time = round(time.time() - ftime, 2)
print(f"It's finished. It only took {time} seconds")
break
else:
testpin = int(testpin)
testpin += 1

There has been some issues with the input() function for some older versions of Spyder. What version of Spyder are you running? If you are running Spyder from the Anaconda distribution, update to the latest available there which is 5.2.2. Close Spyder, open the Anaconda Prompt and run this command: conda install spyder=5.2.2. If you are using the installers or conda-forge the latest is 5.3.2.

@MstFox8, please follow @rhkarls advice and you'll be fine.


text:
UMR not reloading modules, when imported as entire .py file

Issue Report Checklist

[x] Searched the issues page for similar reports
[x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
[x] Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
[ ] Could not reproduce inside jupyter qtconsole (if console-related)
[x] Tried basic troubleshooting (if a bug/error)

[x] Restarted Spyder
[x] Reset preferences with spyder --reset
[x] Reinstalled the latest version of Anaconda
[ ] Tried the other applicable steps from the Troubleshooting Guide

[x] Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description
I am experiencing that Spyder UMR does not reload modules, when import these modules as an entire .py file.
So, for instance, in my project, I have a folder called "Modules".
In this folder I have several .py files, which I use as different modules in my project.
If I import a specific function (my_func) within a module (my_module.py file located in the Modules folder), using:
from Modules.my_module import my_func
The UMR manages to reload the my_module every time.
If I just import the module directly using:
from Modules import my_module
The UMR does not reload the my_module module
These modules typically contain more than one function, so it convenient for me to import an entire module instead of importing the specific functions within the module.
Is there a way to fix this, or do I have to import the functions individually, to get the UMR function to work as intended?
What steps reproduce the problem?

from Modules import my_module
run whatever script that is using my_module

What is the expected output? What do you see instead?
I expected that my_module is being reloaded every time I run the script, which then uses my_module.my_func() at some point.
But this is only the case, when I import the function specifically as
from Modules.my_module import my_func
Versions

Spyder version: 5.3.3
Python version: 3.10.9
Qt version: 5.15.2
PyQt version: 5.15.7
Operating System name/version: Windows 10

Hi,
I have this exact same problem using the new Spyder version:

Spyder version: 6.0.2  (standalone)
Python version: 3.11.10 64-bit
Qt version: 5.15.8
PyQt5 version: 5.15.9
Operating System: Windows-10-10.0.22631-SP0

Any fixes or updates on the matter?
Kind regards,
Hjalte

authors: Jesperten hbengtsson


text:
Bug: Unexpected type 'float' when clicking in Spyder preferences

Problem Description
What steps reproduce the problem?

Just click on preferences in the Spyder toolbar.

Paste Traceback/Error Below (if applicable)
Traceback (most recent call last):
File "C:\Users\dan-s\miniconda3\envs\ciermag-develop\Lib\site-packages\spyder\widgets\helperwidgets.py", line 216, in sizeHint
return QSize(doc.idealWidth(), doc.size().height())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
QSize(): too many arguments
QSize(w: int, h: int): argument 1 has unexpected type 'float'
QSize(a0: QSize): argument 1 has unexpected type 'float'
Versions
Spyder version: 5.5.0
Python version: Python 3.12
Qt version: n/a
PyQt version: PyQt5= 5.15.10
Operating System name/version: Windows10 and Ubuntu

One of the possible solutions implemented is the code below, where the height and width
values are converted to integers.

    def sizeHint(self, option, index):
        options = QStyleOptionViewItem(option)
        self.initStyleOption(options, index)

        doc = QTextDocument()
        doc.setHtml(options.text)
        doc.setTextWidth(options.rect.width())

        return QSize(int(doc.idealWidth()), int(doc.size().height()))

Hey @dan123456-eng, thanks for reporting and also for providing a fix for this! We'll include it in our next version (5.5.1), to be released soon.

Hey @dan123456-eng, thanks for reporting and also for providing a fix for this! We'll include it in our next version (5.5.1), to be released soon.

Thank you


text:
Code completion not working with tensorflow

Description of your problem
Today i installed spyder from anaconda distribution. It has version 3.2.4. When i started to code in spyder editor, i couldn't found any autocomplete function. I am confused now.
Versions and main components

Spyder Version: 3.2.4
Python Version: 3.6
Qt Version:
PyQt Version:
Operating system: OSX
jedi Version: 0.10.2

i couldn't found any autocomplete function.

What do you mean by this?

I looked at issue #4587, you comfirmed that code completion in the Editor doesn't work for all modules, so i may look for other solution.
The weird thing is i have used vim with jedi or youcompleteme, though it may sometimes work slow, but it works. So i don't know why spyder can't do this.

So what module are you trying to get completions for?

numpy, sys, os, etc.  In general, no module works, even local variable autocomplete.

That means you have a problem with Rope or Jedi. How did you install Spyder and its dependencies?

Through anaconda. I tried different jedi version but it doesn't work at all. Now i have jedi 0.10.2 and rope 0.10.5.

I tried to uninstall anaconda and reinstall it and now it works. I will find out what i have done to disable autocomplete.

I just figured out how things happened. When i fleshly installed anaconda, everything is ok. Then i compiled tensorflow from source and using pip under anaconda to install generated whl file. After that, although i could import and use tensorflow in spyder successfully, but code autocomplete didn't work afterwards.

OK, so what is the solution if I do not want to remove and install anaconda? Thx.

I'm having the same issue, but remove and reinstall spyder doesn't bring the auto-completion back (also, the "Go to definition" is not working as well, quite useful when trying to understand the package).
I am using anaconda installed spyder3.2.4 (from conda-forge), running on win7.
I recently upgraded to tensorflow-gpu1.4 using pip (conda windows version only "supported" 1.1), this could cause the trouble, but I've having trouble with auto-completion from time to time before, I just got super frustrated lately when coding more often with TF.
The same problem happens with similar setup on my win10 laptop. Personally I suspect it's more of a windows problem than tf problem?
Hope some one could figure out a solution soon, many thanks!

What happens if you uninstall the pip version of tensorflow and install the conda one?

As I mentioned, I would not use conda tf, since it's very outdated, but for the sake of debugging, I uninstalled pip tf and installed with conda, unfortunately, it does not resolve the problem.
The following packages are in my env after I installed conda tf, perhaps it could give you some hints about what might went wrong. Please note there are duplicated packages installed by pip tf.
packages in environment at C:\ProgramData\Anaconda3:

_license                  1.1                      py36_1    defaults
alabaster                 0.7.10                   py36_0    conda-forge
anaconda                  custom                   py36_0    defaults
anaconda-client           1.6.3                    py36_0    conda-forge
anaconda-navigator        1.6.4                    py36_0    defaults
anaconda-project          0.8.0                    py36_0    conda-forge
asn1crypto                0.22.0                   py36_0    conda-forge
astroid                   1.4.8                    py36_0    conda-forge
astropy                   2.0.2               np112py36_1    conda-forge
babel                     2.4.0                    py36_0    conda-forge
backports                 1.0                      py36_0    defaults
beautifulsoup4            4.6.0                    py36_0    conda-forge
bitarray                  0.8.1                    py36_0    conda-forge
bkcharts                  0.2                      py36_0    conda-forge
blaze                     0.11.3                   py36_0    conda-forge
bleach                    2.0.0                    py36_0    conda-forge
bleach                    1.5.0
bokeh                     0.12.6                   py36_0    conda-forge
boto                      2.48.0                   py36_0    defaults
bottleneck                1.2.1                    py36_1    conda-forge
bzip2                     1.0.6                    vc14_1  [vc14]  conda-forge
ca-certificates           2017.7.27.1                   0    conda-forge
certifi                   2017.7.27.1              py36_0    conda-forge
cffi                      1.10.0                   py36_0    conda-forge
chardet                   3.0.4                    py36_0    conda-forge
click                     6.7                      py36_0    conda-forge
cloudpickle               0.4.0                    py36_0    conda-forge
clyent                    1.2.2                    py36_0    conda-forge
colorama                  0.3.9                    py36_0    conda-forge
comtypes                  1.1.3                    py36_0    conda-forge
conda                     4.3.29                   py36_0    conda-forge
conda-env                 2.6.0                         0    conda-forge
console_shortcut          0.1.1                    py36_1    defaults
contextlib2               0.5.5                    py36_0    conda-forge
cryptography              2.0.3                    py36_0    conda-forge
cudatoolkit               8.0                           3    defaults
cudnn                     6.0                           0    defaults
curl                      7.49.1                   vc14_2  [vc14]  conda-forge
cycler                    0.10.0                   py36_0    conda-forge
cython                    0.26                     py36_0    conda-forge
cytoolz                   0.8.2                    py36_0    conda-forge
dask                      0.15.2                   py36_0    conda-forge
dask-core                 0.15.2                   py36_0    conda-forge
datashape                 0.5.4                    py36_0    conda-forge
decorator                 4.1.2                    py36_0    conda-forge
distributed               1.18.3                   py36_0    conda-forge
docutils                  0.14                     py36_0    conda-forge
entrypoints               0.2.3                    py36_1    conda-forge
enum34                    1.1.6
et_xmlfile                1.0.1                    py36_0    conda-forge
fastcache                 1.0.2                    py36_0    conda-forge
flask                     0.12.2                   py36_0    conda-forge
flask-cors                3.0.3                    py36_0    conda-forge
freetype                  2.7                      vc14_1  [vc14]  conda-forge
get_terminal_size         1.0.0                    py36_0    defaults
gevent                    1.2.2                    py36_0    conda-forge
greenlet                  0.4.12                   py36_0    conda-forge
h5py                      2.7.1                    py36_1    conda-forge
hdf5                      1.8.18                   vc14_0  [vc14]  conda-forge
heapdict                  1.0.0                    py36_0    conda-forge
html5lib                  0.9999999
html5lib                  0.999999999              py36_0    conda-forge
icu                       58.1                     vc14_1  [vc14]  conda-forge
idna                      2.5                      py36_0    conda-forge
imageio                   2.2.0                    py36_0    conda-forge
imagesize                 0.7.1                    py36_0    conda-forge
ipykernel                 4.6.1                    py36_0    conda-forge
ipython                   6.1.0                    py36_0    conda-forge
ipython_genutils          0.2.0                    py36_0    conda-forge
ipywidgets                7.0.0                    py36_1    conda-forge
isort                     4.2.15                   py36_0    conda-forge
itsdangerous              0.24                     py36_1    conda-forge
jdcal                     1.3                      py36_0    conda-forge
jedi                      0.10.2                   py36_0    conda-forge
jinja2                    2.9.6                    py36_0    conda-forge
jpeg                      9b                       vc14_0  [vc14]  conda-forge
jsonschema                2.5.1                    py36_0    conda-forge
jupyter                   1.0.0                    py36_0    conda-forge
jupyter_client            5.1.0                    py36_0    conda-forge
jupyter_console           5.1.0                    py36_0    conda-forge
jupyter_core              4.3.0                    py36_0    conda-forge
lazy-object-proxy         1.3.1                    py36_0    conda-forge
libiconv                  1.14                     vc14_4  [vc14]  conda-forge
libpng                    1.6.28                   vc14_0  [vc14]  conda-forge
libtiff                   4.0.6                    vc14_7  [vc14]  conda-forge
libwebp                   0.5.2                    vc14_7  [vc14]  conda-forge
libxml2                   2.9.4                    vc14_4  [vc14]  conda-forge
libxslt                   1.1.29                   vc14_5  [vc14]  conda-forge
llvmlite                  0.19.0                   py36_0    defaults
locket                    0.2.0                    py36_1    conda-forge
lxml                      3.8.0                    py36_0    conda-forge
Markdown                  2.6.9
markupsafe                1.0                      py36_0    conda-forge
matplotlib                2.0.2                    py36_2    conda-forge
mccabe                    0.6.1                    py36_0    conda-forge
memory_profiler           0.47                     py36_0    conda-forge
menuinst                  1.4.7                    py36_0    defaults
mistune                   0.7.4                    py36_0    conda-forge
mkl                       2017.0.3                      0    defaults
mkl-service               1.1.2                    py36_3    defaults
mpmath                    0.19                     py36_2    conda-forge
msgpack-python            0.4.8                    py36_0    conda-forge
multipledispatch          0.4.9                    py36_0    conda-forge
navigator-updater         0.1.0                    py36_0    defaults
nbconvert                 5.2.1                    py36_1    conda-forge
nbformat                  4.3.0                    py36_0    conda-forge
networkx                  1.11                     py36_0    conda-forge
nltk                      3.2.4                    py36_0    conda-forge
nose                      1.3.7                    py36_2    conda-forge
notebook                  5.0.0                    py36_0    conda-forge
numba                     0.34.0              np112py36_5    defaults
numexpr                   2.6.4                    py36_0    conda-forge
numpy                     1.13.3
numpy                     1.12.1                   py36_0    defaults
numpydoc                  0.7.0                    py36_0    conda-forge
odo                       0.5.1                    py36_0    conda-forge
olefile                   0.44                     py36_0    conda-forge
opencv                    3.3.0                  py36_200    conda-forge
openpyxl                  2.5.0a3                  py36_0    conda-forge
openssl                   1.0.2l                   vc14_0  [vc14]  conda-forge
packaging                 16.8                     py36_0    conda-forge
pandas                    0.20.3                   py36_1    conda-forge
pandoc                    1.19.2                        0    conda-forge
pandocfilters             1.4.1                    py36_0    conda-forge
partd                     0.3.8                    py36_0    conda-forge
path.py                   10.3.1                   py36_0    conda-forge
pathlib2                  2.3.0                    py36_0    conda-forge
patsy                     0.4.1                    py36_0    conda-forge
pep8                      1.7.0                    py36_0    defaults
pickleshare               0.7.4                    py36_0    conda-forge
pillow                    4.2.1                    py36_0    conda-forge
pip                       9.0.1                    py36_0    conda-forge
ply                       3.10                     py36_0    conda-forge
prompt_toolkit            1.0.15                   py36_0    conda-forge
protobuf                  3.4.0               py36_vc14_1  [vc14]  conda-forge
protobuf                  3.4.0
psutil                    5.2.2                    py36_0    conda-forge
py                        1.4.34                   py36_0    conda-forge
pycodestyle               2.3.1                    py36_0    conda-forge
pycosat                   0.6.2                    py36_0    conda-forge
pycparser                 2.18                     py36_0    conda-forge
pycrypto                  2.6.1                    py36_1    conda-forge
pycurl                    7.43.0                   py36_1    defaults
pyflakes                  1.6.0                    py36_0    conda-forge
pygments                  2.2.0                    py36_0    conda-forge
pylint                    1.6.5                    py36_0    conda-forge
pyodbc                    4.0.17                   py36_0    conda-forge
pyopenssl                 17.2.0                   py36_0    conda-forge
pyparsing                 2.2.0                    py36_0    conda-forge
pyqt                      5.6.0                    py36_4    conda-forge
pysocks                   1.6.7                    py36_0    conda-forge
pytables                  3.4.2                    py36_6    conda-forge
pytest                    3.2.1                    py36_0    conda-forge
python                    3.6.2                         0    conda-forge
python-dateutil           2.6.1                    py36_0    conda-forge
pytz                      2017.2                   py36_0    conda-forge
pywavelets                0.5.2                    py36_1    conda-forge
pywin32                   220                      py36_1    conda-forge
pyyaml                    3.12                     py36_1    conda-forge
pyzmq                     16.0.2                   py36_2    conda-forge
qt                        5.6.2                    vc14_1  [vc14]  conda-forge
qtawesome                 0.4.4                    py36_0    conda-forge
qtconsole                 4.3.1                    py36_0    conda-forge
qtpy                      1.3.1                    py36_0    conda-forge
requests                  2.18.4                   py36_1    conda-forge
rope                      0.10.7                   py36_0    conda-forge
ruamel_yaml               0.11.14                  py36_0    conda-forge
scikit-image              0.13.0                   py36_1    conda-forge
scikit-learn              0.19.0              np112py36_0    defaults
scipy                     0.19.1              np112py36_0    defaults
seaborn                   0.8.1                    py36_0    conda-forge
setuptools                36.6.0
setuptools                36.3.0                   py36_0    conda-forge
simplegeneric             0.8.1                    py36_0    conda-forge
SimpleITK                 1.0.1
singledispatch            3.4.0.3                  py36_0    conda-forge
sip                       4.18                     py36_1    conda-forge
six                       1.10.0                   py36_1    conda-forge
six                       1.11.0
snowballstemmer           1.2.1                    py36_0    conda-forge
sortedcollections         0.5.3                    py36_0    conda-forge
sortedcontainers          1.5.7                    py36_0    conda-forge
sphinx                    1.6.3                    py36_0    conda-forge
sphinxcontrib-websupport  1.0.1                    py36_0    conda-forge
spyder                    3.2.4                    py36_0    conda-forge
sqlalchemy                1.1.13                   py36_0    conda-forge
statsmodels               0.8.0                    py36_0    conda-forge
sympy                     1.1.1                    py36_0    conda-forge
tblib                     1.3.2                    py36_0    conda-forge
tensorflow-gpu            1.1.0               np112py36_0    defaults
tensorflow-tensorboard    0.4.0rc2
testpath                  0.3.1                    py36_0    conda-forge
tk                        8.6.6                    vc14_5  [vc14]  conda-forge
toolz                     0.8.2                    py36_0    conda-forge
tornado                   4.5.1                    py36_0    conda-forge
traitlets                 4.3.2                    py36_0    conda-forge
typing                    3.6.2                    py36_0    conda-forge
unicodecsv                0.14.1                   py36_0    conda-forge
urllib3                   1.22                     py36_0    conda-forge
vc                        14                            0    conda-forge
vs2015_runtime            14.0.25420                    0    conda-forge
wcwidth                   0.1.7                    py36_0    conda-forge
webencodings              0.5                      py36_0    conda-forge
werkzeug                  0.12.2                   py36_0    conda-forge
wheel                     0.30.0
wheel                     0.29.0                   py36_0    conda-forge
widgetsnbextension        3.0.2                    py36_0    conda-forge
win_inet_pton             1.0.1                    py36_1    conda-forge
win_unicode_console       0.5                      py36_0    defaults
wincertstore              0.2                      py36_0    conda-forge
wrapt                     1.10.11                  py36_0    conda-forge
xlrd                      1.0.0                    py36_1    conda-forge
xlsxwriter                0.9.8                    py36_0    conda-forge
xlwings                   0.11.4                   py36_0    conda-forge
xlwt                      1.2.0                    py36_0    conda-forge
yaml                      0.1.6                    vc14_0  [vc14]  conda-forge
zict                      0.1.2                    py36_0    conda-forge
zlib                      1.2.11                   vc14_0  [vc14]  conda-forge

I have the same issue when I removed the Anacoda Tensorflow and installed the last version of it (1.4) using the pip. Autocomplete stopped.

@ccordoba12
Let me conclude this bug for you. Definitely this problem exists. The package must be installed with Anaconda itself, I mean even if we install the Tensorflow from Anaconda cloud, but with a different owner (such as aaronzs), it will not work either. The reason is unknown for me. it is quite weird.
Also, this problem seems to be for Tensorflow only. I did installed the keras using pip (because Anaconda one is old) and it did not affect the autocomplete.

Exact same thing happened to me, just pip upgraded tensorflow and keras. Reopened spyder and autocomplete didn't work.

Closing as a duplicate of issue #5782. Please read that issue to get the solutions for this problem.

authors: Jiang-Li VanitarNordic ccordoba12 huchhong philnguyenresson qianyizhang


text:
Automatic error report

No information provided.

authors: CAM-Gerlach jinoantony


text:
Mac and Spyder 4.0

Minor problem with a Mac and using Anaconda Spyder 4.0.0b1
The normal spyder opens up but the icons for new files and open directory do not work.
Work around is to use the file explorer to search for file but a bit cumbersome.
'Nobody expects the spanish inquisition'

Please post a screenshot of the buttons you say don't work. Thanks!

We'll take a look at this for beta2. Please stop closing and opening the issue, there's no need for that.

Thanks @bcolsen. Closing as a duplicate of #7111.


text:
PR: Create UpdateManager Plugin

This PR supersedes PR #20900
Description of Changes
General Changes

The existing update mechanism is removed from the Application plugin to its own UpdateManager plugin. This allows a simplified paradigm where the plugin container can take the role of signal dispatcher between the main UpdateManagerWidget and the UpdateManagerStatus status bar widget.
A preference pane was created for the Update Manager that contains "Check for updates at startup" and "Check for stable releases only" preferences. The check at startup preference was removed from the "Application" preference pane.
The update urls and messaging are essentially unchanged from the recent 5.x PR (#21402, #21423, and #21433).

Update Flow

Upon commencing with the install, Spyder will quit and the installation/update process will proceed.
If the update downloaded a conda-based installer, an interactive graphical uninstaller will launch (Windows) or an interactive command-line uninstaller is executed at a shell terminal (macOS, Linux). For all platforms, the interactive graphical installer is launched upon successful completion of the uninstall process.
If the update did not require downloading a conda-based installer, a shell terminal will inform the user that Spyder is being updated via conda, and conda's standard output is displayed.
In all scenarios, Spyder will start/restart upon successful install/update.
For current versions that are not conda-based installs, only downloading the conda-based installer will result in installing an update. If the user rejects this option, the user is only instructed how to perform the update, but no automatic update will be peformed.

Class Mermaid Map
classDiagram
  class ProgressDialog { }
  class UpdateManager { }
  class UpdateManagerConfigPage { }
  class UpdateManagerContainer { }
  class UpdateManagerStatus { }
  class UpdateManagerWidget { }
  class WorkerDownloadInstaller { }
  class WorkerUpdate { }
  UpdateManagerConfigPage --* UpdateManager : CONF_WIDGET_CLASS
  UpdateManagerContainer --* UpdateManager : CONTAINER_CLASS
  UpdateManagerStatus --* UpdateManagerContainer : update_manager_status
  ProgressDialog --* UpdateManagerWidget : progress_dialog
  UpdateManagerWidget --* UpdateManagerContainer : update_manager
  WorkerDownloadInstaller --* UpdateManagerWidget : download_worker
  WorkerUpdate --* UpdateManagerWidget : update_worker

Issue(s) Resolved

Fixes #20831
Interactive Testing
Interactive testing is most easily performed using the following script. Just copy and save  this somewhere and run it from a Spyder developer environment.
interactive_test.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import argparse
import logging
from unittest.mock import patch
from spyder.utils.qthelpers import qapplication
from spyder.plugins.updatemanager import workers
from spyder.plugins.updatemanager.widgets import update
from spyder.plugins.updatemanager.widgets.update import UpdateManagerWidget

logging.basicConfig()
_logger = logging.getLogger('spyder.plugins.updatemanager')
_logger.setLevel(10)

parser = argparse.ArgumentParser()
parser.add_argument('-v', '--version', type=str, help="Spyder current version")
parser.add_argument('-s', '--stable-only', action='store_true', default=False,
                    help="Check for stable releases only")
parser.add_argument('-e', '--env', choices=['conda', 'app', 'pip'],
                    default='conda', help='Environment type')
parser.add_argument('-a', '--anaconda', action='store_true', default=False,
                    help="Anaconda pkg installed")
parser.add_argument('-c', '--channel', default='conda-forge',
                    choices=['conda-forge', 'main', 'develop'],
                    help="Spyder conda channel")

cli_opts = parser.parse_args()

if cli_opts.env == 'app':
    is_conda = True
    is_anaconda_pkg = False
    is_conda_based_app = True
    spyder_conda_channel = ('conda-forge',
                            'https://conda.anaconda.org/conda-forge/osx-64')

if cli_opts.env == 'conda':
    is_conda = True
    is_anaconda_pkg = cli_opts.anaconda
    is_conda_based_app = False
    spyder_conda_channel = {
        'conda-forge': ('conda-forge',
                        'https://conda.anaconda.org/conda-forge'),
        'main': ('pkgs/main', 'https://repo.anaconda.com/pkgs/main'),
        'develop': ('pypi', None),  # local install
    }[cli_opts.channel]

if cli_opts.env == 'pip':
    is_conda = False
    is_anaconda_pkg = False
    is_conda_based_app = False
    spyder_conda_channel = (None, None)

def mock_get_conf(self, option, *args, **kwargs):
    if option == 'check_stable_only':
        return cli_opts.stable_only
    else:
        return super(UpdateManagerWidget, self).get_conf(option, *args, **kwargs)

for mod in [workers, update]:
    for attr, new in [
        ('__version__', cli_opts.version),
        ('is_conda_based_app', lambda: is_conda_based_app),
        ('is_anaconda', lambda: is_conda),
    ]:
        patch.object(mod, attr, new=new).start()
patch.object(update, 'is_anaconda_pkg', new=lambda: is_anaconda_pkg).start()
patch.object(workers, 'get_spyder_conda_channel',
             new=lambda: spyder_conda_channel).start()
patch.object(UpdateManagerWidget, 'get_conf', new=mock_get_conf).start()

app = qapplication()
um = UpdateManagerWidget(None)
um.start_check_update()
app.exec()

However, this will only be interactive with the plugin. To test the full interactivity with Spyder, see the interactive instructions in #20900.

Hello @mrclary! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

In the file spyder/plugins/updatemanager/workers.py:

Line 203:22: E127 continuation line over-indented for visual indent

Checked this locally and not totally sure if I'm doing things correctly but seems like I'm unable to trigger a major release update 🤔 I was able to trigger a minor release update manually though :+1:
Steps followed (extrapolating from the steps at https://github.com/spyder-ide/spyder/pull/20900#issue-1697717335)

Install latest 6.0.0a2 (via conda-installer)
Update conda-based installation.

Checkout the https://github.com/mrclary/spyder/tree/cbi-updater-plugin  branch locally.
Modify the following files in the Spyder repository:

spyder/__init__.py. Change the version on line 32 to (5, 4, 4, "dev0").
spyder/plugins/updatemanager/widgets/update.py. Change the delay interval on line 197 from 60000 ms to 10000 ms.
spyder/plugins/updatemanager/scripts/install.bat. Remove -y from the conda install command on line 66 (.bat) to allow you to cancel a conda update without clobbering your existing install.

Install superqt and qdarkstyle 3.2 over the spyder-runtime env created by the Spyder 6.0.0a2 conda-installer
Run the following command in a terminal/cmd window to update the conda-based Spyder.conda run --live-stream -p "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime" python "E:\Acer\Documentos\Spyder\Spyder otros\mrclary\spyder\install_dev_repos.py" --not-editable

Update Flow that partially worked (minor version, check via manual trigger)

Start Spyder.
The updater should run at Spyder launch (I had to trigger the Check updates... action manually otherwise I got the status bar just displaying Spyder 5.4.4.dev0).

Testing for a minor update, Spyder will be updated in-place using conda mechanisms (worked as described :+1:).

You should be alerted that Spyder 5.4.5 is available and whether you want to proceed to install it. Click "Yes".
Spyder will quit.
A terminal/cmd window appears and displays the progress of the conda update. After the environment solve, do not confirm the changes: type "n" and hit return. You do not want to proceed with the conda update.
After the terminal/cmd window closes, Spyder will launch.

Update Flow that didn't work (major version - the update available dialog showed me 5.5.0 always)

Testing for a major update, a conda-based installer will be downloaded and launched.

You should be alerted to Spyder 5.5.0 being available and whether you want to proceed to install it (I had to trigger the Check updates... action manually otherwise I got the status bar just displaying Spyder 5.4.4.dev0 as before). Click "No".
Open Preferences->Update Manager and uncheck Check for stable releases only.
Click Check for updates... in the Help menu (or clicking over the status bar).
You should be alerted that version Spyder 6.0.0a2 is available and whether you want to download and install it (in my tests I always got 5.5.0 🤔 ). Click "Yes". This will initiate downloading the conda-based installer.
After the download is complete, a message box will appear asking if you want to proceed with the installation. Click "Yes".
Spyder will quit.
Spyder's uninstall script will launch interactively in a terminal asking if you wish to uninstall Spyder (macOS or Linux), or a Windows Uninstaller will launch (Windows). Cancel the uninstall operation.
After the uninstall terminal/window is closed, the installer should launch. Cancel the installer.

It's possible that I'm missing setting up something (for example I didn't change the updates worker code since seems like the url should point to the GitHub release page which has the alpha release?) so will try to check again

@dalthviz, thanks for looking at this! I think I found the issue. When getting a list of updates from GitHub, the versions are listed in chronologically released order, rather than release order, so 5.5.0 always shows up last:
['4.2.4', '4.2.5', '5.0.0', '5.0.1', '5.0.2', '5.0.3', '5.0.4', '5.0.5', '5.1.0', '5.1.1', '5.1.2', '5.1.3', '5.1.4', '5.1.5', '5.2.0', '5.2.1', '5.2.2', '5.3.0', '5.3.1', '5.3.2', '5.3.3', '5.4.0', '5.4.1', '5.4.2', '5.4.3', '6.0.0a1', '5.4.4', '5.4.5', '6.0.0a2', '5.5.0']
I'll fix this and push it up.

@dalthviz, I've pushed up fixes.

Checking again seems like once a check for updates is started things are working as expected (at least for the most straigh forward flow where you say yes to everything) :+1: Just in case, tested setting the version without "dev0" but still seems like the check for updates is not being done automatically even if the Check for updates on startup option is enabled 🤔 Couple of screenshots showing how things are looking on Windows with the conda-installers:
Minor release update:

Launch Spyder and get the update dialog message (still needs to be lauched manually though 🤔):

Click Yes and Spyder closes and a cmd showing the update process shows up:

Due to testing setup then you get prompt to continue or not with the installation:

Spyder is relauched when the cmd closes:

Major release update (with the option to get only stable release unchecked):

Launch Spyder and get the update dialog message (still needs to be lauched manually though 🤔):

Click Yes and then the download dialog starts:

After finishing the install dialog appears:

Click Yes, Spyder closes and a cmd shows as well as the uninstall installer wizard:

When the uninstaller closes the installer is launched (regarding this, should we somehow check if Spyder is actually uninstalled and depending on that show the installer or just relaunch Spyder?):

Will try now to test other actions combinations (like for example cancel the download or select to install the update after closing Spyder) and document anything if I manage to see any weird behaviors or issues

@dalthviz, thanks for following up. I'll investigate why Spyder does not check for updates at startup.

should we somehow check if Spyder is actually uninstalled and depending on that show the installer or just relaunch Spyder?

I agree that this should be done at some point. We can discuss whether we should defer until later or not, depending on how involved such a check would be.

@dalthviz, I found the issue and pushed up the fix. It was just a typo preventing checking for update at startup.

Awesome! Indeed, seems like now the automatic check for updates on startup works :+1:
Started checking some other actions combinations and noticed the following when doing a major release update:

If you click Yes, wait for the installer download to finish, then click After closing and the click over the status bar you get prompted to download again the installer:

Maybe we need to save the downloaded installer somehow and skip that step when clicking the status bar if that was already done?
Also, I think I got to see the cmd with the output for an update to Spyder 5.5.0 after closing Spyder when the update dialog showed me a major update to 6.0.0a2 although that only happened one time 🤔. I will try to see what could be triggering that or if was just a tests setup error on my side

@dalthviz, if the installer is downloaded, it should not ask to download it again. I'll check to see what the issue is.

@dalthviz, I pushed up the fix. The issue was that verifying the existing download failed due a wrong data type comparison.
To verify the download, I store the download file size read from the url request header and compare this to the actual download file size. This ensures that the download can be verified even if Spyder is restarted or offline. Is there a better way to do this?

I pushed up the fix. The issue was that verifying the existing download failed due a wrong data type comparison.

Yep, checked again with the latest changes and now things are working :+1:

To verify the download, I store the download file size read from the url request header and compare this to the actual download file size. This ensures that the download can be verified even if Spyder is restarted or offline. Is there a better way to do this?

Maybe if we make available from the release the MD5 checksum values for the installers we could use them to check the downloaded file or any previous downloaded installer integrity? Besides that not totally sure 🤔

Maybe if we make available from the release the MD5 checksum values for the installers we could use them to check the downloaded file or any previous downloaded installer integrity? Besides that not totally sure 🤔

Yeah. I was thinking something similar. Maybe we could explore this type of option in a follow-up PR.

Maybe we could explore this type of option in a follow-up PR.

Sound good to me :+1:
Also, I gave this a last manual check and one last thing that maybe could be worthy to give some thought is the handling of the Check stable versions only when changed. Maybe it could make sense to restart the update state (status bar message for example) to show again the current version installed when the option is changed? Or even not only that but prompt the users to see if they want to check for updates? Currently what I see is that the previous check result persist even when you change the option. That can lead to some strange interactions where you could be prompt to install a version that doesn't match with the setting. For example, an unstable version was discovered previously and now you check the option to just see if an stable update is available. In that case you would see something like:

Besides this behavior seems like everything else is working as expected, at least from the side of the installer on Windows. Will try now to give a check to the code :+1:

@dalthviz, that is a good observation. I'll look into changing the status bar when the preference is changed.

@dalthviz, The statusbar is now updated appropriately when changes to the "Check stable versions only" preference is applied.

@mrclary, I was quite advanced in my review when I noticed that, in my opinion, this PR has a big problem regarding its git history, which seriously affects a more careful review and also our future usage of git blame for all this code.
The problem is that in your first commit you removed files such as:

spyder/plugins/application/widgets/install.py
spyder/plugins/application/widgets/status.py
spyder/workers/updates.py
spyder/workers/tests/test_update.py

and then recreated them in your second commit under the new UpdateManager plugin. Instead, what you should have done is using git mv to move those files and then fix their imports to make them work under the new plugin.
These actions made all those file appear as new, which doesn't allow me to see what you actually changed in them. And as far as I can tell (by copy/pasting a previous and new file in an online diff editor) is quite a bit, but of course not all.
So, my suggestions for you are:

Create a new branch with an initial commit as the one I mentioned (i.e. using git mv and fixing imports).
Copy/paste the changed files in your second commit here to that branch and do a second commit.
Cherry-pick every following commit done here to the new branch.

That will show a nice diff for review and also preserve the git history of all moved files for future git blame.
Let me know if that's ok for you or you need a hand with it.

@ccordoba12, thanks for looking at this PR.
I understand what you are saying regarding the git history. There was so much refactoring, in addition to moving to the new plugin, that the new files don't really resemble the old ones, so I thought the diffs would be more confusing than helpful.
Nevertheless, I can do as you suggest.
This is what I will do:

Create a new branch with the recommended preserved history.
Create a new PR with the new branch for you to inspect.
If you confirm that the new branch/PR is what you want, then I will just reset the branch of the current PR to the newly created branch, force-push the changes, and discard the newly created PR.

@ccordoba12, actually I just pushed the changes up to this PR. I have a backup branch locally I can reset to if need be.

There was so much refactoring, in addition to moving to the new plugin, that the new files don't really resemble the old ones, so I thought the diffs would be more confusing than helpful.

I understand your reasoning but from what I saw (using a diff editor, as I told you) the diffs of some files at least are readable and important to understand what you exactly changed in this PR.

Nevertheless, I can do as you suggest.

Yes, please do.

This is what I will do:

I agree with that and thanks for taking the extra effort of doing it.

actually I just pushed the changes up to this PR. I have a backup branch locally I can reset to if need be.

I don't understand this message. Are you planning to open a new PR? Or just push directly here with the new history?

I don't understand this message. Are you planning to open a new PR? Or just push directly here with the new history?

Sorry for the confusion. I just pushed directly here with the new history.

@mrclary, this is still a bit of mess. For instance:

You moved spyder/plugins/application/widgets/install.py to spyder/plugins/updatemanager/widgets/install.py without modifications. But it seems changes to that file were actually done in spyder/plugins/updatemanager/widgets/update.py, which appears as new here.
The same is true for spyder/plugins/updatemanager/updates.py and spyder/plugins/updatemanager/workers.py (i.e. the first one moved without modifications and second one where the changes were done).

At this point I don't know if this work could be saved somehow or if it'd be better to start over in a new branch and PR.

@mrclary, this is still a bit of mess. For instance:

You moved spyder/plugins/application/widgets/install.py to spyder/plugins/updatemanager/widgets/install.py without modifications. But it seems changes to that file were actually done in spyder/plugins/updatemanager/widgets/update.py, which appears as new here.
The same is true for spyder/plugins/updatemanager/updates.py and spyder/plugins/updatemanager/workers.py (i.e. the first one moved without modifications and second one where the changes were done).

At this point I don't know if this work could be saved somehow or if it'd be better to start over in a new branch and PR.

@ccordoba12, you are correct. I did not execute it properly and I overlooked some of those file renames. I apologize for the inconvenience; I'll try one more time.

@ccordoba12, I think this should be good now. I notice for files that both moved and renamed, GitHub diff shows the original as deleted and the new as a new file, i.e. not compared. However, the git history does show the diffs. GitHub diff behaves as expected for files that are only moved. If there are still issues, then perhaps I'm doing something wrong and we should discuss this via zoom. I'll be unavailable tomorrow and Tuesday between 9am-5pm PST, but evenings would be okay.

@mrclary, thanks for your work to address my review promptly! I took a quick look at it and things seem fine to me now.
@dalthviz, could you give this PR a new review to check that @mrclary's latest changes didn't break what was already working? Thanks!

Giving this a new manual check locally, seems like there is an issue related with the settings (the report error dialog pop-up when unchecking the Check for stable releases only option and clicking the preference dialog Apply or Ok buttons):
Traceback (most recent call last):
  File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\lib\site-packages\spyder\plugins\preferences\widgets\configdialog.py", line 185, in button_clicked
    configpage.apply_changes()
  File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\lib\site-packages\spyder\plugins\preferences\widgets\config_widgets.py", line 119, in apply_changes
    self.apply_callback()
  File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\lib\site-packages\spyder\plugins\preferences\widgets\config_widgets.py", line 154, in <lambda>
    apply_callback=lambda: self._apply_settings_tabs(
  File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\lib\site-packages\spyder\plugins\preferences\widgets\config_widgets.py", line 193, in _apply_settings_tabs
    self.apply_settings(options)
  File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\lib\site-packages\spyder\plugins\application\confpage.py", line 286, in apply_settings
    um = self.plugin.get_plugin(Plugins.UpdateManager, error=False)
  File "C:\Users\dalth\AppData\Local\spyder-6\envs\spyder-runtime\lib\site-packages\spyder\api\plugins\new_api.py", line 444, in get_plugin
    raise SpyderAPIError(
spyder.api.exceptions.SpyderAPIError: Plugin "update_manager" not part of REQUIRES or OPTIONAL requirements!

Also, I noticed that there are a couple of ECHO esta desactivado lines on the cmd shown when updating a minor version:

Thanks @dalthviz. I'll add UpdateManager to the OPTIONAL list in Application plugin.
Regarding ECHO is deactivated, I'm not sure what that is. @echo off is used at the top of the script, but that just disables echoing each command that executes 🤷🏼

Also, I noticed that there are a couple of ECHO esta desactivado (ECHO is deactivated) lines being shown in the cmd when updating a minor version:

This should be fixed now also.

Checked again locally and seems like everything is working :tada: so this LGTM :+1:

Thanks @dalthviz and @ccordoba12 for all the feedback!


text:
PR: Added validation to window/position config value saved in spdyer.ini

Fixes #3748

Other than a minor comment, this looks good to me. Thanks @dalthviz!

Good job, thanks @dalthviz!


text:
PR: Fix AttributeError in jedi_plugin

Also add a regression test.
Fixes #6516.

Hello @jitseniesen! Thanks for submitting the PR.

In the file spyder/utils/introspection/tests/test_jedi_plugin.py, following are the PEP8 issues :

Line 48:80: E501 line too long (81 > 79 characters)

Apologies for not doing it right the first time, but as penance you get a new test (and hopefully an increase in coverage).

Apologies for not doing it right the first time

No worries


text:
🛑 Client Website - 10yearstheshow.com is down

In 3cf243d, Client Website - 10yearstheshow.com (https://10yearstheshow.com) was down:

HTTP code: 404
Response time: 271 ms

Resolved: Client Website - 10yearstheshow.com is back up in e8d3600 after 11 minutes.

repo: sqbxmediagroup/status


text:
Battery voltage

Is it possible to measure the battery voltage?
Or have you considered using the adc with a voltage divider?

Hi @gordonendersby!
Currently the ADC is not in use for Badgy, so you can connect a voltage divider (e.g. 220K/100K) and connect it to the ADC pin. This may be available in the next version :). Thanks!

Ive worked this out now after reminding myself how to measure the internal vcc.
The internal ADC can measure the battery. No need for voltage dividers unless you want to measure an outside source or other analogue source.
Ideally before the wireless is turned on due to drain.
`/* Needed to point adc at internal vcc*/
ADC_MODE(ADC_VCC);
/* in startup */
float vccVolt = ((float)ESP.getVcc())/1024;
`
It would be great if you just broke out any spare pins to pads that a pin header can be connected too.

Closed as you can use internal ADC to VCC

The internal ADC measures the input voltage to the ESP, which is regulated by the LDO, not the actual battery's voltage.

authors: gordonendersby sqfmi

repo: sqfmi/badgy


text:
Sqlc generating string field instead of custom type

Version
1.10.0
What happened?
I created a new postgresql type:
CREATE TYPE "location_coordinates" AS (
    longitude       double precision,
    latitude        double precision
);

And then I use it in a table:
CREATE TABLE "table" (
  ...
  "location_coordinates" location_coordinates NOT NULL,
  ...
);

Generated model contains string instead of generating the proper type
type Table struct {
	...
	LocationCoordinates string
	...
}

Playground URL
https://play.sqlc.dev/p/2dbb77a8eb5cd8aaa6ad076785d53033bfc814bbbdb2806d719403f2aeaf992b
What operating system are you using?
Windows
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go

Tracking in #2760

authors: gionapaolini kyleconroy

repo: sqlc-dev/sqlc


text:
CIS Tests for Symmetric and Asymmetric Keys

A New PR
THANK YOU - We love to get PR's and really appreciate your time and help to improve this module
Accepting a PR
Before we accept the PR - please confirm that you have run the tests locally to avoid our automated build and release process failing. You can see how to do that in our wiki
https://github.com/sqlcollaborative/dbachecks/wiki
Please confirm you have 0 failing Pester Tests
[X] There are 0 failing Pester tests
Changes this PR brings

CIS test for symmetric encryption level of at least AES_128
CIS test for asymmetric key size of at least 2048

Please add below the changes that this PR covers. It doesnt need an essay just the bullet points :-)

I lied this one was ready to go, I forgot I had just forgotten to push code up and you didn't actually ask for any changes....oops :)

repo: sqlcollaborative/dbachecks


text:
Add support for --autoMerge and --autoMergeMethod

Implements support for setting auto-merge on created backport PRs.
See
https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request
and
https://docs.github.com/en/graphql/reference/mutations#enablepullrequestautomerge

@sqren I did implement a enablePullRequestAutoMerge.private.test.ts pointed to my fork for testing, but didn't commit it. I wasn't sure how you would want to handle.

I did implement a enablePullRequestAutoMerge.private.test.ts pointed to my fork for testing, but didn't commit it. I wasn't sure how you would want to handle.

Awesome! Can you commit it and I'll create a repo under https://github.com/backport-org.
Btw. lmk if you have better ideas for these types of e2e tests. I've found them super valuable and easy to write but it seems a bit fishy that I have to create the repo like in this case.

I can, but I'll have to flesh it out more. For example, it needs to make
sure that the option gets disabled after each test
On Wed, Feb 10, 2021, 5:59 PM Søren Louv-Jansen notifications@github.com
wrote:

I did implement a enablePullRequestAutoMerge.private.test.ts pointed to my
fork for testing, but didn't commit it. I wasn't sure how you would want to
handle.
Awesome! Can you commit it and I'll create a repo under
https://github.com/backport-org.
Btw. lmk if you have better ideas for these types of e2e tests. I've found
them super valuable and easy to write but it seems a bit fishy that I have
to create the repo like in this case.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sqren/backport/pull/248#issuecomment-777092008, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAF7M5AK746DSMNH64IBRRTS6MFVHANCNFSM4XN2AGEQ
.

For example, it needs to make sure that the option gets disabled after each test

Ah, true!

@sqren I added enablePullRequestAutoMerge.private.test.ts. The tests are currently gated until the TEST_* constants at the top are filled in.

lmk if you have better ideas for these types of e2e tests.

When you're writing something that's whole purpose is to integrate with a thing, and you can't run your own version of that thing, this is pretty much all you can do for e2e tests. It's super easy to just say "it's not worth it" and not do e2e tests at all, so good on you for setting them up!

Released in v5.6.5

authors: brianseeders sqren

repo: sqren/backport


text:
Don't upload artifacts for samples

We were never uploading these anyways, but a previous change in
#691 accidentally forced all
subprojects into uploading. So we now we need to explicitly opt out for
samples.

i'm going to merge this since it's fixing a bug I introduced and blocking our internal build

repo: square/misk


text:
HeldCertificate.Builder().build() throws java.security.NoSuchAlgorithmException on Android if targetSdk is 28

okhttp version: 3.12
Testcase: https://gist.github.com/geaden/59da90b01e8419a09d2a9704989b0c77
If app targetSdk is 28 the test is failed with exception:
java.lang.SecurityException: exception: java.security.NoSuchAlgorithmException: The BC provider no longer provides an implementation for Signature.SHA256withECDSA.  Please see https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html for more details.
at org.bouncycastle.x509.X509V3CertificateGenerator.generateX509Certificate(Unknown Source:25)
at org.bouncycastle.x509.X509V3CertificateGenerator.generateX509Certificate(Unknown Source:3)
at okhttp3.tls.HeldCertificate$Builder.build(HeldCertificate.java:403)

If app targetSdk is lower then 28 it passes as described in androiddev blog post: https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html

For apps targeting an API level before P, the call will return the BC implementation and log a warning in the application log. For apps targeting Android P or later, the call will throw NoSuchAlgorithmException.

It seems org.bouncycastle.x509.X509V3CertificateGenerator is deprecated
Specifying rsa2048 as in https://github.com/square/okhttp/issues/4175#issuecomment-438909529 produces exception for Signature.SHA256withRSA

@geaden can you check the fix above?

Hi @swankjesse! I did check okhttp-tls version from your branch and the test passed. Thanks!

No, 3.12.X is not actively maintained.  So you will need to patch and build it yourself if this is blocking you.

authors: geaden swankjesse yschimke

repo: square/okhttp


text:
Bump requirements to Android 5+, Java 8+

For the release OkHttp 3.13 I’d like to change our requirements from this:

Android 2.3+ (released December 6, 2010)
Java 7+ (released July 2011)

To this:

Android 5.0+ (released November 12, 2014)
Java 8+ (released March 2014)

These minimums ensure our TLS stack supports both TLSv1.2 and ALPN. Requiring TLSv1.2 is important because we’re soon going to disable TLSv1.0 and TLSv1.1 by default!
I think we want to ship Java 8 bytecode and use lambas and method references. Downstream Android applications may need to enable desugaring in D8 when building APKs.
We should avoid hard requirements on Java 8 APIs (java.time). We will instead continue to offer them as convenience overloads. Java 8 APIs aren’t available until API 26 (released August 2017).

Would we consider releasing 3.12.x with critical security fixes, or just abandon really old clients?  FWIW I'm for this, I just think it's worth stating what the plan would be.

OkHttp works with Okio 2, but doesn't require it. If you find bugs, we’ll fix ’em.
As for a general policy on what platforms we’ll require, it’s difficult because there’s many competing trade-offs. We want to our libraries to be secure, small, correct, and fast. Usually in that order of preference!
Requiring Android 5 is about TLSv1.2. We might also be able to get it working on Android 4.4 since that release has some opt-in support for TLSv1.2. Needs investigation!

My concern are caused because for example Moshi 1.8 did require Okio 2.1 and did not work with 2.0.
From your writing, if couroutines are added in Okio 2.x and not 3.x I can assume that it should work with OkHttp 3.12.x and you'll make necessary fixes if necessary?
Dropping 70K users with a large part paid ones is not an easy thing to do, specially when I maintain an app since more than 7 years and have a close relationship with the users.
Android 4.4 would be nice it's 85% of those 70k and seems more acceptable, even if a solution without https support for 16+ would be nice too.
Or is there a way to have Okio linked for Moshi and other usage but tell OkHttp to not use it at runtime?

I was maybe not clear, I do understand the implication about OkHttp and how to handle it.
The issue is about keeping OkHttp 3.12 preventing me to update the other things (Okio/Moshi) due to breaking changes that would be incompatible with OkHttp 3.12. If moshi 1.9 fix an issue for me or improve performance and require Okio 2.2 that does not work with OkHttp 3.12 then I will have an issue.
I already do ABI split, adding SDK split would start to be really hard to manage from version numbering point of view and would not solve this other libraries update issue.
If you can stay API 19+ I can plan and announce a 16-18 drop in the coming months, if you keep 21+ then I need to start a complete analysis about my internal Okio / Moshi usages to ensure to issues in the future with my planned refactoring and usages and eventually seek for alternatives.

All future releases of Okio 1.x and 2.x will work with OkHttp 3.12.x. We’re pretty strict about compatibility!

Ok thanks that was the main blocking point from my first comment :)
Now I'll just hope you'll find a way for 19+ to simplify my future life.

Can we be sure that TLS v1.2 is enabled on all devices on API 21, including Samsung? https://github.com/square/okhttp/issues/2372#issuecomment-244807676

@vibin I think we have the most tolerant code in place here https://github.com/square/okhttp/blob/a74901501e37aa8dc2939a306e5013f9d1aebe1b/okhttp/src/main/java/okhttp3/internal/platform/AndroidPlatform.java#L332
So on API 21 it should try "TLSv1.2", then fallback to "TLS"

Dropping support for API level 19 seems quite aggressive, given 7.6% of devices are still using it (according to https://developer.android.com/about/dashboards/). If the goal is to disable something by default, is it in any way feasible to do that based on Build.SDK_INT >= 19?

About Java 8+, note that some java 8 apis are only available on Android starting from Android 7/Nougat.

@calvarez-ov we're using a Maven plugin called Animal Sniffer to warn us if we inadvertently use an API we shouldn't.

Instead of install Google SSL provider by users, we can use Conscrypt library SSL provider inside Okhttp itself.
if (Build.VERSION.SDK_INT < 21 && Security.getProvider("Okhttp") == null){
    Security.insertProviderAt(new OpenSSLProvider("Okhttp"), 1);
}

@swankjesse Is there any chance to allow using new OkHttp along with Conscrypt on KitKat devices or is there a reason for not doing so? For now OkHttp will crash under this case due to a fail fast piece of code in Platform.kt. Then I tried with a bit code changed, and it runs well on the KitKat emulator.
The code causing crash:
val isSupported: Boolean = when {
      !isAndroid -> false
      else -> {
        // Fail Fast
        check(
            Build.VERSION.SDK_INT >= 21) { "Expected Android API level 21+ but was ${Build.VERSION.SDK_INT}" }

        true
      }
    }

I changed the check call to a comparison, plus a minor change in the ConscryptPlatform preventing a NoClassDefFoundError, then the code seems to run well with Conscrypt. But I did not test it thoroughly.

@hqzxzwb please build your own OkHttp .jar and try it!

I'm sure everyone that needs to has probably gotten this working but in the general case for Android API16 and higher (a reasonable minimum, at this point) TLS1.2 is not so hard, here is exactly how in an app with tons of users verifying it works: https://github.com/ankidroid/Anki-Android/pull/5658/commits/47feecb9ac2e215bc56f387d043ccf9b271c032d#diff-36861f300e525ff4bc27048485a2ae3dR211
But I'm mainly commenting to see if anyone has investigated all the fancy new de-sugaring in Android Studio 4.0 to see if that could allow me (with my thousands upon thousands of Android <5 users) to move forward on this dependency to the modern branches. I might try it myself but someone may have done so already

@mikehardy OkHttp 3.12.12 will already do most of what your Tls12SocketFactory does
https://github.com/square/okhttp/blob/okhttp_3.12.x/okhttp/src/main/java/okhttp3/internal/platform/AndroidPlatform.java#L445
Not sure about the rest of the code or desugaring.

How did I miss that? Thanks for the pointer @yschimke I will test that and likely be able to delete unnecessary code, a maintainer's favorite thing...

authors: Tolriq calvarez-ov hqzxzwb matnbaz mikehardy ojw28 swankjesse vibin yschimke