Idea for new entry point: cmake.package

Scikit-build-core already supports the cmake.prefix entry point, which appends the value to CMAKE_PREFIX_PATH. In theory, this will allow projects that install lib/cmake/<package>/<package>-config.cmake to automatically be found by consuming projects. However, this does not work in cases where:

The package uses a non-standard convention
The package installs in lib64/cmake/<package>/<package>-config.cmake, and the consuming package is built on a Debian-based system, because in this case, FIND_LIBRARY_USE_LIB64_PATHS is set to FALSE

In theory, the exporting project could set cmake.prefix to <wheel-name>/lib64/cmake/<package>, because the find_package() search procedure does look directly in the values of CMAKE_PREFIX_PATH in addition to the various subdirectories listed. However, that is only conventional on Windows, and I don't consider it good practice to set CMAKE_PREFIX_PATH to <wheel-name>/lib64/cmake/<package>, when prefixes are really meant to have lib64/cmake/<package> within them.
I propose an alternative: a new entry point called cmake.package, that is used like so in entry_points.txt:
[cmake.package]
ExamplePackage = "example/lib64/cmake/example"

In this case, scikit-build-core would pass -DExamplePackage_DIR=/home/user/.local/lib/python3.12/site-packages/example/lib64/cmake/example to CMake. The *_DIR variable tells CMake exactly where to find a package file, rather than giving it a list of prefixes to search through their subdirectories. There's no ambiguity, and it works with any package layout, as long as the config file is named <Package>Config.cmake or <package>-config.cmake.
But it gets even better! With the CMake File API, we can even automatically figure out if the project is exporting any package config files. By searching through the installer keys, it can search for file installers that install <package>-config.cmake or <Package>Config.cmake, and export installers that install <package>-targets.cmake or <Package>Targets.cmake. If it finds the two together, it's a pretty safe bet that that's a CMake package config file, and scikit-build-core can automatically create an entry point for it. (Note that this would be more ambiguous if the <package>-config.cmake convention is used, since that loses casing information. In that case, we could defer to the export name, or just not support the <package>-config.cmake convention.)
Note that if the heuristics used by the automatic entry point creation are incorrect for any reason, the package creator can still manually specify a cmake.package entry point to override the automatic creation procedure.

Great idea!
To flesh out this a bit more, how should the project define the CMakePackageConfigHelpers calls to support standard and wheel install paths, e.g. INTALL_DESTINATION. Probably it's more an issue of convention. There are <pkg>.libs folder structure that are used to store bundled dependency libraries so probably something similar is in order, something to store stuff under site_packages.
There is also auditwheel that can potentially move (or rather copy) dependencies into <pkg>.libs folder. Any idea on how to integrate with that, e.g. how to avoid doubling the libraries is another scikit-build-core package also provides it?
On Fedora packaging side, we also have to figure out how to point the entry_point there to the system installed one.
On python side, it would have to look slightly different because afaik, the entry_point must point to a python loadable path, but I don't see a reason why that path can't be made to be a valid python path with scikit-build-core generated metadata to point to  store the actual paths.

After doing some research on entry points, I understand them a little better, and have a better idea of how we would go about this.
The entry point would look more like:
[cmake.package]
ExamplePackage = "example:cmake_package_dir"

And then in example/__init__.py:
import importlib.resources as rs

def cmake_package_dir(_package_name):  # _package_name is ignored here, but could theoretically be used
    return rs.files(__package__) / "lib64/cmake/example"

There is also auditwheel that can potentially move (or rather copy) dependencies into <pkg>.libs folder. Any idea on how to integrate with that, e.g. how to avoid doubling the libraries is another scikit-build-core package also provides it?

I believe auditwheel only copies the runtime dependencies (*.so files), not CMake package config files, so it shouldn't be an issue.

I believe we had this idea at the beginning, got stuck on if it should set _DIR or _ROOT, and then somehow didn't end up adding either...
IIRC _ROOT is the better one?

No. *_ROOT specifies a prefix to search through various subdirectories (lib, lib64, lib/cmake, etc.) while *_DIR specifies exactly where to find the file. We know exactly where the file is at installation time, so there's no reason not to record it and remove all of the ambiguity.

We've been supporting directly specifying the directory and not requiring an entry point function. It just needs to be a valid Python module, which is pretty much just a directory.

Ahh, but a module path could resolve to several physical paths. But I think we could just then pick the one with the config file in it?

We've been supporting directly specifying the directory and not requiring an entry point function.

How? How does the consuming project find the directly-specified directory?

Ahh, but a module path could resolve to several physical paths. But I think we could just then pick the one with the config file in it?

Shouldn't be a problem. The idea is that scikit-build-core generates a vanilla python module that stores the path to the Config.cmake file. Similar to the editable install approach. Then scikit-build-core loads the function/attribute to get the path that it should populatein the _ROOT/_DIR variable.

We've been supporting directly specifying the directory and not requiring an entry point function.

How? How does the consuming project find the directly-specified directory?

I guess you can always define cache variables manually, but not sure if it refers to that. And also this seems to be the reverse, i.e. the installed package defines what and where Config.cmake it provides, instead of the dependent having to define where to search. I don't believe there is a functionality for the former

I don't believe there is a functionality for the former

Right. I'm proposing adding functionality for this:

the installed package defines what and where Config.cmake it provides

so that consuming packages don't have to know things about the dependency's wheel layout.

Hmm, also occurs to me, how would one disable the preference of the entry_points? For CMAKE_PREFIX_PATH it is somewhat doable if we make sure to append to the existing value, but _ROOT and _DIR have top-most priority so probably those should not be used.
The longterm proper solution would probably be to write a DependencyProvider interface like vcpkg apparently already does? But then how would we enable multiple DependencyProvider or find them?

Kyle and I were discussing this earlier and I am supportive of the idea.

We've been supporting directly specifying the directory and not requiring an entry point function.

How? How does the consuming project find the directly-specified directory?

I think Henry was referring to the fact that with the cmake.prefix entrypoint projects just specify a module and SKBC loads that module, rather than specifying an object within the module to call.

The idea is that scikit-build-core generates a vanilla python module that stores the path to the Config.cmake file.

Could you actually stick to the above and simply specify the relative path to the directory? Directories are (namespace) packages, therefore importable modules, so I think you could just take the resulting module's __file__ (ep.load().__file__) as the <package>_DIR I believe.

Hmm, also occurs to me, how would one disable the preference of the entry_points? For CMAKE_PREFIX_PATH it is somewhat doable if we make sure to append to the existing value, but _ROOT and _DIR have top-most priority so probably those should not be used.

Are you imagining a situation where there are multiple providers of a config file with the same name? I don't know if there is a good way to avoid them clobbering each other in this case. _ROOT would sort of work for this because CMake allows it to be a list of directories instead of a single one, but we don't want to use that for the reasons Kyle enumerated above, and also that would introduce an arbitrarily ordering. Conversely _DIR is a single location, so there is no way to preserve multiple. I'm not sure that this is a situation that we should worry about, though. If you were to install these packages into your sysroot they would clobber each other anyway, and similarly if you were to add multiple conflicting configs to the CMAKE_PREFIX_PATH.

I think Henry was referring to the fact that with the cmake.prefix entrypoint projects just specify a module

Yes, also cmake.module. These work by simply providing the module that contains the CMake files, and the tool using them (scikit-build-core) can get the directory(s) from that. As long as it's a file-based loader. Other loaders could be handled eventually, by realizing the directory, but it's probably not needed realistically and could be handled eventually (at least for newer Pythons).
Anyway, we should not be discussing changing the current system in this issue - the new entry point should be just like the existing pair (minus the extra detail that the name matters).[^1]
[^1]: By the way, entry points only work if the package is installed into site-packages; we don't support packages installing into data/headers, etc. If we wanted to try to support this, we could do it this time. But that means users would need custom functions that located the cmake module, etc.

Are you imagining a situation

I think this was about how to disable an installed Python module forcing its CMake files to be found. If you had "thing" installed with thing = "thing.resources.cmake", for example, how would you instead get it to select a non-Python installed "thing"? We could potentially not set thing_DIR if thing_DIR was defined, but that would force someone to define it.
When we were first discussing this (can't find records, probably was around community meeting 5 or so), I think we had the idea that users could supply ignore patterns on the entry point names.
By the way, going back to the beginning:

But it gets even better! With the CMake File API, we can even automatically figure out

We can't add an entry point automatically unless a user sets this in their dynamic array, that's a PEP 621 rule. Which means they know about it and probably could just actually set the entry point; explicit is better than implicit. And if we needed a custom function, this is out, we can't automatically add Python functions to a package!
Also:

when prefixes are really meant to have

I don't think that's required, though.  AFAICT this is just trying to make something that already works a bit "nicer" conceptually?

Could you actually stick to the above and simply specify the relative path to the directory? Directories are (namespace) packages, therefore importable modules, so I think you could just take the resulting module's __file__ (ep.load().__file__) as the <package>_DIR I believe.

The issue I see is that it wouldn't be able to support pointing to system packages like /usr/lib64/cmake because all of the path would have to be converted to python package, which obviously cannot be the case for /usr/.... Distro packaging would be affected by this, but also spack, conda, etc. In principal we could patch out that entry point, but it would be preferred to keep things consistent, who knows how other tools will start assuming these.

Are you imagining a situation

I think this was about how to disable an installed Python module forcing its CMake files to be found.

Indeed, basically going by the general CMake guidelines to not define (top-level) user configurations inside a CMakeLists.txt. In a similar manner we should keep those empty such that the end-user can define them inside tools.scikit-build.cmake.define or as --config-settings. There could be checks if those variables are defined, but I think it would make it too complicated for the user to follow. CMAKE_PREFIX_PATH on the other hand is standardized and used everywhere. (Btw, how would the cache variable interact with the env-variable?)

I believe we had this idea at the beginning, got stuck on if it should set _DIR or _ROOT, and then somehow didn't end up adding either...
IIRC _ROOT is the better one?

_ROOT has extended behavior where it is propagated to any nested find_dependency or find_package call  from the parent. That allows for a project that ship third party dependencies to find the packaged version.

_ROOT has extended behavior where it is propagated to any nested find_dependency or find_package call from the parent. That allows for a project that ship third party dependencies to find the packaged version.

Interesting, can you expand on that with an example or upstream documentation? From my reading it means that if you are in find_package(PkgA) that used PkgA_ROOT, and you called a find_dependency(PkgB) it will search in PkgA_ROOT as well?

_ROOT has extended behavior where it is propagated to any nested find_dependency or find_package call from the parent. That allows for a project that ship third party dependencies to find the packaged version.

Interesting, can you expand on that with an example or upstream documentation? From my reading it means that if you are in find_package(PkgA) that used PkgA_ROOT, and you called a find_dependency(PkgB) it will search in PkgA_ROOT as well?

https://cmake.org/cmake/help/latest/command/find_package.html
The package root variables are maintained as a stack so if called from within a find module, root paths from the parent's find module will also be searched after paths for the current package. This can be skipped if NO_PACKAGE_ROOT_PATH is passed or by setting the [CMAKE_FIND_USE_PACKAGE_ROOT_PATH](https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_USE_PACKAGE_ROOT_PATH.html#variable:CMAKE_FIND_USE_PACKAGE_ROOT_PATH) to FALSE.

Definitely should use either _ROOT or CMAKE_PREFIX_PATH given this info

If you wanted to point at .../lib/... vs. .../lib64/..., it would quite hard with the current "simple" entry points; you'd actually need to modify the entry point based on the build, which probably can be done via dynamic-metadata, but is non-trivial. So our new cmake.root entry-point could either be a pointer to a object that produces the entry point, or we could extend all three to differentiate between a package only (classic method) or a package + object, which would call the function.
Not sure if we should also specify some way to scope the access, since a package is not guaranteed to be on disk, but the file we want needs to be accessible via a disk-based path for at least the duration of the CMake call. We could make the object a context manager, for example.

I think we need to first start with how would the user use CMakePackageConfigHelpers macros. I can't envision right now if it would be an issue. What would the site_packages folder look like?


Rustfmt moves comment from one import to another

Here is a case where rustfmt, as part of reordering imports, literally moves a comment from one import to another, entirely destroying its meaning:
mod realstd {
    struct __FastLocalKeyInner;
}
mod local {
    mod fast {
        struct Key;
    }
}

#[cfg(test)] // comment associated with realstd import
pub use realstd::thread::__FastLocalKeyInner;
#[cfg(test)]
pub use self::local::fast::Key as __FastLocalKeyInnerUnused; // comment associated with fast import

fn main() {}

After formatting, the imports look like
#[cfg(test)]
pub use self::local::fast::Key as __FastLocalKeyInnerUnused;
#[cfg(test)] // comment associated with realstd import
pub use realstd::thread::__FastLocalKeyInner; // comment associated with fast import

Not that the comment that explained the use self::local::fast::Key as, got moved to the other use!
This is with rustfmt 1.5.1-nightly (2022-08-05 affe0d3).

closing as a duplicate of #3720


Swagger Annotation doesnt work for same uri same http method but different request params and being lost in swagger spec generation

Hi
I have to 2 methods both has same URI same http method GET but passing different request parameter. Both methods has different business logic.when i am putting swagger annotation on both, only one is getting documented in spec generation. Is there any way to document both?
below is the sample code:
1st Method:
@ApiOperation(value = "Returns method 1 response, response = MyResponse.class)
@RequestMapping(method = RequestMethod.GET, value = "/bankEbill")
@ResponseBody
public MyResponse getMyBillsResponse(HttpServletRequest request,
HttpServletResponse response)

2nd Method:
@ApiOperation(value = "Returns method 2 response, response = MyResponse.class)
@RequestMapping(method = RequestMethod.GET, value = "/bankEbill", params = { "billId" })
@ResponseBody
public MyResponse getMyBillResponse(@RequestParam("billId") long billId,
 HttpServletRequest request,HttpServletResponse response)

@pankajvijay2008 you're using Springfox and not swagger-core, so the issue should be opened there and not here. However, the current version uniquely identifies an operation based on the HTTP method and the path - the parameters are not used to identify it. As such, you cannot describe that use case in general.

+1


Add version: JetBrains.PyCharm.Community version 222.3739.56

Result: Installation Successful

Manifest
Add/Remove Programs

Name
PyCharm Community Edition
PyCharm Community Edition 2022.2.1

Version
222.3739.56
222.3739.56

Publisher
JetBrains s.r.o.
JetBrains s.r.o.

ProductCode

PyCharm Community Edition 2022.2.1

Auto-updated by vedantmgoyal2009/winget-pkgs-automation in workflow run 2808
Microsoft Reviewers: Open in CodeFlow

Close with reason: Already merged;


Referencing a .fs file in a different folder kills all hints & intellisense

The following script, test.fsx does not show any intellisense, tooltips or code lenses:
#load "../foo.fs"

let x = 5

Assume that foo.fs is a file living in the folder directly above the script. It doesn't matter if the code in foo.fs is valid or not.

There are two "workarounds" I have found that fixes the issue:

Move foo.fs to the same folder level as test.fsx.
Renaming foo.fs to foo.fsx.

However, neither are viable solutions when e.g. working with file dependencies sourced from paket.

I have been having the same issue for the last few versions.
My workaround is to include the project's root folder with an absolute path:
#I "C:/Source/ProjectA"
Then I can reference packages and load .fs-files with intellisense still working:
#r @"packages\FSharp.Data\lib\net45\FSharp.Data.dll".
...
#load @"Reporting\src\MetaData.fs"
...

Maybe something has changed since this was reported, but I'm experiencing this issue with a .fsx loading a .fs in the very same directory, either by using the filename or a relative path.
Using an absolute path fixes the issue.

Pinging this as it's quite old - just wondering if anything has changed in the ecosystem in this time to fix it - or if not, what steps are required to solve it?

@Krzysztof-Cieslak in new Ionide 4 world, is there any chance that this is "fixable"? :-)


Added support for Ubuntu and Linuxmint.

This one is work in progress and cannot be merged. I'll keep you updated when everything is in place (should be very soon) and support for Linuxmint is ready.

Hi, after I was able to release a bunch of updates I has implemented support for Linuxmint in util role. This needs to get released. When this is done, I'll update etckeeper role to support Linuxmint as well. Please stay tuned and thanks for your contributions!


Gmail is not working

Expected Behavior

Current Behavior

Screenshots (if appropriate):
Possible Solution

Steps to Reproduce (for bugs)

Context

Your Environment

Franz Version used:
Operating System and version:

@adlk I think you can close and lock this


Python support not available when loading from clingo module

If you have an ASP file with an embedded python function and then load that file from a python program (using the clingo module) it raises a RuntimeError "error: python support not available".
Here's a simple example. Python file foo.py:
 from clingo import Control

 ctrl = Control()
 ctrl.load("bar.lp")

 ctrl.ground([("base",[])])
 with ctrl.solve(yield_=True) as sh:
     for m in sh: print(m)

and ASP file bar.lp:
 a(@func(1)).

 #script(python)

 def func(a): return a

 #end.

Run it from the command line:
$ python foo.py
Traceback (most recent call last):
  File "foo.py", line 4, in <module>
    ctrl.load("bar.lp")
  File "/home/daver/local/miniconda3/envs/tmpclingo/lib/python3.8/site-packages/clingo/control.py", line 362, in load
    _handle_error(_lib.clingo_control_load(self._rep, path.encode()))
  File "/home/daver/local/miniconda3/envs/tmpclingo/lib/python3.8/site-packages/clingo/_internal.py", line 65, in _handle_error
    raise RuntimeError(msg)
RuntimeError: bar.lp:3:1-7:6: error: python support not available

Note: I can still call the python function from within ASP if I remove the script(python) block and move the function into the python file.

Just to add to the discussion... the above works in clingo 5.4. Also you could be even tricker and conditionally call an embedded main() function.
So file foo.py:
from clingo import Control

ctrl = Control()
ctrl.load("bar.lp")

if "main" in dir():
    print("Calling embedded main")
    main(ctrl)
else:
    print("Calling default ground-solve behaviour")
    ctrl.ground([("base",[])])
    with ctrl.solve(yield_=True) as sh:
        for m in sh: print(m)

I am not convinced that it is really important to have this feature. If we already are using Python as a host language, it is probably best to put functions in the context object passed to ground. The only useful case that I can imagine is that an encoding with embedded functions is meant to be used by clingo and in a Python program.
I still had a look at how this could be implemented. The API already has a (hidden) function to register Lua and Python scripts. One could make this a public API and allow to register (arbitrary) scripting languages.

The use case for this feature is if you want to write your own clingo application wrapper; where you want to add some feature but otherwise want it to behave "normally", in terms of being able to call embedded python functions. Is there some way you could do this without this feature?
But, as you said on the discussion board, the security aspect of allowing arbitrary code to be loaded into the main module is certainly a concern. The script is loaded later so can be used to override existing functions.
Having a public API to register arbitrary scripts sounds like a nice idea.

@daveraja if you have the time please have a look. I had to change quite some code and hopefully did not introduce bugs.


Please add comments or suggestions

Please add comments or suggestions.
I think I addressed most of the suggestions in the original PR found here: https://github.com/remind101/dbsnap-verify/pull/1
A version of this code has been running on and off in stage for many months.

@remind101/ops-engineering bump on this.

Hey @phobologic a lot has changed since your last review. Could I get another before I merge?

@ejholmes please take another pass when you have a chance.

@Lowercases feel free to add comments if you want to.

It looks good in general! As for the code itself, I think it goes over my head so I'll defer to trust it if it's been throughly tested :) I did leave a single suggestion nevertheless.

@remind101/ops-engineering please have another pass before I merge.

Other than what we talked about with alarms, this lgtm! :+1:


How to fetch image path?

In previous versions I did use self.kf.webURL, but now it's deprecated. How to get image url path?

It was once used internally to identify the download task. But since the request can be modified so it is not accurate to use webURL for that purpose. In Kingfisher 5, it just returns nil and the URL is not stored anymore inside the image view.
May I know what you are doing with it, so I can give you some suggestion or an alternative solution.

I'm doing an extension for UIImageView
extension UIImageView {
    var imagePath: String? {
        get {
            trace("Can't fetch image path.", type: .error)
            return nil
        }
        set {
            self.kf.setImage(with: URL(string: newValue!),
                             placeholder: UIImage(named: Constants.Various.imagePlaceholderImage),
                             options: [.transition(.fade(0.3))])
        }
    }
}

There are some cases, when i need to get the imagePath from UIImageView.

Maybe you need to track it yourself in this case. :( I am sorry for that.


ExternalSignInAsync fails

So, I am trying to login using Windows authentication, over the internet.
First I connected to Domain, using PrincipalContext, like this
using (var context = new PrincipalContext(ContextType.Domain, "domain_name"))
{
     UserPrincipal userPrincipal = UserPrincipal.FindByIdentity(context, userName);
     var valid = context.ValidateCredentials(userName, password);
     if (valid)
     {
          var loginInfo = new ExternalLoginInfo
          {
               DefaultUserName = userPrincipal.GivenName + " " + userPrincipal.Surname,
               Login = new UserLoginInfo("Windows", userPrincipal.Sid.ToString())
          };
         signInStatus = await ExternalSignInAsync(loginInfo, isPersistent);
     }
}

userPrincipal.Sid is correct - validated it.
The thing is this code was working couple days ago, when I demoed. But all of a sudden it stopped working and I have no idea.
I checked all my configuration changes.
applicationhost file is correct,
<section name="windowsAuthentication" overrideModeDefault="Allow" />

Authentication - Windows is set to Read/Write in my IIS delegation setting.
And I checked all the code, everything is as it should be.
It stopped working in QA environment, which has not been deployed since few days and it was working fine yesterday in QA.
It also stopped working in Local.
What do you think might be wrong.
Update 1:
I even tried
var user = await UserManager.FindAsync(new UserLoginInfo("Windows", "my sid"));

But the user is null.

Based on your last update, seems the problem is with finding the user using the external login info. Are you using a custom user manager or asp.net default ?

I am using asp.net default user manager.
Other users are facing similar issues with using external logins... Just in case it might ring any bell for you...
http://stackoverflow.com/questions/19453293/asp-net-mvc-5-vs2013-final-facebook-login-with-owin-fails-logininfo-is-null/21439834#21439834
http://stackoverflow.com/questions/20737578/asp-net-sessionid-owin-cookies-do-not-send-to-browser/21234614#21234614
http://stackoverflow.com/questions/28215962/net-identity-2-0-facebook-externallogin-logininfo-returns-null

That's different from your case, GetExternalLoginInfoAsync reads the external cookie, In your case you are not doing that!
Also you state that a direct call to your user store UserManager.FindAsync(new UserLoginInfo("Windows", "my sid")); does not return the user!!
Open your DB and check the UserLogins table and see if you can find a record matching the provided info

loginProvider
providerKey

Windows
my sid

Oh. That's my bad.
I want to login the windows user without storing it's record in UserLogins table, since we have a service that authenticates the user.
The requirement I have is to login the user without creating a record in UserLogins, can I just do SignInAsync() by passing the user that doesn't exist in database?
Thank you very much!

No, if you are using the default asp.net UserManager. At least you must have some custom logic to map the windows user to a local user account and then call SignInAsync passing the local account.

Do you know how it is possible to map windows user to a local user account, without creating a record in database.
Thank you!

How do you register your windows users ?

Windows users just like web users, enter their username and password when they login over the internet. Then we have a service that accepts username and password and tell us whether the user is valid. We don't do registration for windows users.

Since you don't do registration for windows users, then perhaps create dummy local accounts!
string userName = string.Format("{0}@{1}", userName, domainName);
var user = await UserManager.FindByNameAsync(userName);
if(user == null){
  //first time login, create local account with no password.
  var result = await UserManager.CreateAsync(user);
  if (!result.Succeeded)
    throw new ApplicationException("Failed to create local account");
}
await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);

But does it not create a record in User table.
Can I just log the user in from code, without going to database.

You could do:
string userName = string.Format("{0}@{1}", userName, domainName);
var user = new ApplicationUser { UserName = userName, Email = userName };
await SignInManager.SignInAsync(user, isPersistent:false, rememberBrowser:false);

But things will turn ugly in case any DB call is made by the SignInManager, for example checking if the user email or phone number are confirmed!

Thanks for your reply MohammadYounes.
I tried implementing the above code but it is throwing an exception with a message. UserId is null
Is there anything I can do to skip this error.

Such exception is very much expected! You are trying to make a system that is based around user to work without one.


Changed the send function to a arrow function

Doesn't particularlly matter, but I suppose it's something that can be done.

That's true. I just thought it would help beginners who use classes then Solaris doesn't have to keep telling them to change it to an arrow function but I understand.


[[FIX]] Allow comma expression in MemberExpression

Coverage remained the same at 100.0% when pulling b4e55fe2fa1427ef52400ad117e5670a0bacbe6c on jugglinmike:comma-in-member into c13c5cc2be9e5ac6ea1355b47d84e818d8ca135f on jshint:master.

Coverage remained the same at 100.0% when pulling b4e55fe2fa1427ef52400ad117e5670a0bacbe6c on jugglinmike:comma-in-member into c13c5cc2be9e5ac6ea1355b47d84e818d8ca135f on jshint:master.

Coverage remained the same at 100.0% when pulling b4e55fe2fa1427ef52400ad117e5670a0bacbe6c on jugglinmike:comma-in-member into c13c5cc2be9e5ac6ea1355b47d84e818d8ca135f on jshint:master.


Feature/ghg final feedback

PIVOTAL

filter names changes
optgroups for sector filter
unit for per capita/GDP
fix trim of empty data for years, leaving that in the middle (ex. PIK AFG per capita)
table with chart data
updating colors for GHG chart

With colors could be more "fun". Bigger samples or with text are easily distinguishable, but with our little dots and lines on the chart sometimes not so much.

I'm also not sure if we have to format the values in the table the same way as on the chart and tooltip? "2.3Gt", "10Mt" or leave it as it is as a raw number.

One small change needed on the label of "Gasses" you're missing an s, on the filters dropdown.


Instructor groq example not working

[x ] I have tried searching the documentation and have not found an answer.

What Model are you using?

[ x] Other : groq with mixtral

Describe the bug
Trying the example from instructor hub or described on https://python.useinstructor.com/hub/groq/ , but getting an error.
% python groq_example.py
Traceback (most recent call last):
  File "/Users/Development/lab/structured-output/instructor/groq_example.py", line 16, in <module>
    client = instructor.from_openai(client, mode=instructor.Mode.MD_JSON)
  File "/opt/homebrew/Caskroom/miniconda/base/envs/instructor/lib/python3.10/site-packages/instructor/client.py", line 274, in from_openai
    assert isinstance(
AssertionError: Client must be an instance of openai.OpenAI or openai.AsyncOpenAI

To Reproduce
Get the described example on https://python.useinstructor.com/hub/groq/  and run.
It seems instructor client.py is expecting openai.OpenAI  as described on line 274 of client.py, so the example will never work.
Maybe I'm missing something?

I just created a pull request #561 with a possible from_groq solution.


feat: translate the genesis state given by hive into a valid genesis state for Madara

The genesis state for Madara contains 3 main fields: declared contract classes (mapping class hashes to class), deployed contracts (mapping starknet address to class hash) and storage (mapping a tuple of contract address and storage key to a value). The genesis of rpc tests contains EOA addresses that need to be funded with a certain amount and contracts that need to be deployed at a specific address, with a specific bytecode and sometimes some storage. The script written should thus be able to:

Map EMV addresses to Starknet addresses given the Kakarot address.
Modify genesis storage to fund EVM addresses.
Deploy bytecode at a EVM contract address.
Set the storage for a EVM contract address.

### Tasks
- [ ] https://github.com/kkrt-labs/kakarot-rpc/issues/354
- [ ] https://github.com/kkrt-labs/kakarot-rpc/issues/382
- [ ] https://github.com/kkrt-labs/kakarot-rpc/issues/377
- [ ] https://github.com/kkrt-labs/kakarot-rpc/issues/379
- [ ] https://github.com/kkrt-labs/kakarot-rpc/issues/384
- [ ] https://github.com/kkrt-labs/kakarot-rpc/issues/394

Spec needed @greged93

Unassigning @ftupas for now as he is currently focusing on test sequencer on eth-rpc crate in kakarot-rpc #365
Always possible to reassign you when you come back to this task,
Next sub-task in this issue:

identify next step after util compute_starknet_address is done and add to the tasklist
solve the resulting sub issue first

Closing this as all subtasks are done


Support Java 21

Describe the enhancement requested
Java 21 LTS release
Component(s)
Build

@Fokko I can take a look at that


Flutter tool cannot attach to any process

Steps to Reproduce

Start a Flutter app via flutter run -v and grab the Observatory URL (eg. http://<IP_ADDRESS>:54655/a2zuiehTqFQ=/).
In another terminal session, run flutter attach --debug-uri=http://<IP_ADDRESS>:54655/a2zuiehTqFQ\=/ -v.

Logs

The attach command printed out these logs:
[  +31 ms] executing: [/Users/cyandev/Developer/libraries/flutter/] git log -n 1 --pretty=format:%H
[  +45 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[        ] 7a4c33425ddd78c54aba07d86f3f9a4a0051769b
[        ] executing: [/Users/cyandev/Developer/libraries/flutter/] git describe --match v*.*.* --first-parent --long --tags
[  +14 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.5.4-hotfix.2-0-g7a4c33425
[  +12 ms] executing: [/Users/cyandev/Developer/libraries/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +12 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/Users/cyandev/Developer/libraries/flutter/] git ls-remote --get-url origin
[  +12 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +60 ms] executing: [/Users/cyandev/Developer/libraries/flutter/] git rev-parse --abbrev-ref HEAD
[  +13 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[ +335 ms] executing: /Users/cyandev/Library/Android/sdk/platform-tools/adb devices -l
[  +11 ms] Exit code 0 from: /Users/cyandev/Library/Android/sdk/platform-tools/adb devices -l
[        ] List of devices attached
[   +6 ms] executing: idevice_id -h
[   +3 ms] /usr/bin/xcrun simctl list --json devices
[ +258 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FuchsiaCacheArtifacts' is not required, skipping update.
[ +168 ms] Connecting to service protocol: http://<IP_ADDRESS>:54655/a2zuiehTqFQ=/

And then it had no response forever.
After some of my debugging, I found that the WebSocket behind the scene behaved strangely.
I set a breakpoint at the flutter_tools' vmservice.dart:89:
  while (socket == null) {
    attempts += 1;
    try {
>     socket = await constructor(uri.toString(), compression: compression);
    } on io.WebSocketException catch (e) {
      await handleError(e);
    } on io.SocketException catch (e) {
      await handleError(e);
    }
  }

And I let it go, the socket variable is set to a non-null instance and no error is thrown, but the connection is indeed closed. Here is my Wireshark log:
GET /a2zuiehTqFQ=/ws HTTP/1.1

54655 → 54682 [ACK] Seq=1 Ack=339 Win=407936 Len=0 TSval=1436864806
TSecr=1436864806

HTTP/1.1 101 Switching Protocols

54682 → 54655 [ACK] Seq=339 Ack=358 Win=407936 Len=0 TSval=1436864807
TSecr=1436864807

54682 → 54655 [FIN, ACK] Seq=339 Ack=358 Win=407936 Len=0 TSval=1436864807
TSecr=1436864807

54655 → 54682 [ACK] Seq=358 Ack=340 Win=407936 Len=0 TSval=1436864807
TSecr=1436864807

WebSocket Connection Close [FIN]

54682 → 54655 [RST] Seq=340 Win=0 Len=0

The socket at the flutter_tools side closed abnormally.
To validate that, I write a little program:
import 'dart:io';

Future main() async {
  final WebSocket ws = await WebSocket.connect("ws://<IP_ADDRESS>:53318/4vpF_Md6LRo=/ws", compression: CompressionOptions.compressionDefault);
  ws.add("Hello");
}

Unfortunately, this program also didn't work. I think the WebSocket implementation in Dart SDK is buggy.

There is a similar issue that maybe help:
https://github.com/dart-lang/sdk/issues/34838

Hi @unixzii
I see there's an open issue addressing the case you described.
(thank you @unixzii )
Please follow up on that issue,
I'm closing the current one as duplicate.
If you disagree please write in the comments
and I will reopen it.
Thank you


Add version: YuzuEmu.Yuzu.Mainline version 1338

Pull request has been created with Komac v1.5.1 :rocket:
Microsoft Reviewers: Open in CodeFlow

@wingetbot run


OAK-10977 - Cleanup IndexDefinition class

replace Guava usages with JDK equivalents
fix typos
improve formatting

Be careful when replacing ImmutableList.of()- in Guava, it preservers iteration ordering...

Be careful when replacing ImmutableList.of()- in Guava, it preservers iteration ordering...

In the JDK, List.of and List.copyOf also preserve the order by which the elements are added. The problem might be in replacing a Guava by an JDK Set. In Guava, the iteration order is deterministic, but in the JDK the iteration order changes each time the JVM is restarted (they use some kind of randomness to ensure that users do not rely on a fixed iteration order in sets).
Tomorrow I will look more carefully at the usages of the sets in this class to make sure no code is depending on the iteration order of sets, which anyway would be a bug.

Be careful when replacing ImmutableList.of()- in Guava, it preservers iteration ordering...

In the JDK, List.of and List.copyOf also preserve the order by which the elements are added. The problem might be in replacing a Guava by an JDK Set. In Guava, the iteration order is deterministic, but in the JDK the iteration order changes each time the JVM is restarted (they use some kind of randomness to ensure that users do not rely on a fixed iteration order in sets).
Tomorrow I will look more carefully at the usages of the sets in this class to make sure no code is depending on the iteration order of sets, which anyway would be a bug.

I looked at all the cases of usages of Map or Set, and i did not find any that seemed to be relying on the order of iterations being always the same.


Can you help me in another paper?

Hello！
Last year, when you reproduced the code SISC（https://github.com/OPEN-AIR-SUN/SISC）, you found a bug and solve it！
Now, I get the same problem too，can you tell me how to solve it ！
Thank you very much！

Hello,
it's really long time and I don't remember what was the problem but I found the code that I used. I hope it can help
#!/usr/bin/env python3

import logging
import numpy as np
import plyfile
import skimage.measure
import time
import os
from monoscene.models.monoscene2 import MonoScene2
from monoscene.data.semantic_kitti.kitti_dm import KittiDataModule
import click

def create_mesh(
    batch, model, filename, N=256, max_batch=64 ** 3, offset=None, scale=None
):
    start = time.time()
    ply_filename = filename
    voxel_origin = [0, 0, 0]
    voxel_size = 1.0

    model.eval()

    sdf_values = model.get_discrete_sdf(batch, (N, N, N//8))
    sdf_values = sdf_values.reshape((N, N, N//8))
    sdf_values = np.abs(sdf_values)
    end = time.time()
    print("sampling takes: %f" % (end - start))

    convert_sdf_samples_to_ply(
        sdf_values,
        voxel_origin,
        voxel_size,
        ply_filename + ".ply",
        level=0.035,
        offset=offset,
        scale=scale,
    )

def convert_sdf_samples_to_ply(
    sdf_values,
    voxel_grid_origin,
    voxel_size,
    ply_filename_out,
    level,
    label=None,
    offset=None,
    scale=None,
    ):
    '''
    Convert sdf samples to .ply with semantic infomation
    :param sdf_values: a numpy array of shape (n,n,n)
    :voxel_grid_origin: a list of three floats: the bottom, left, down origin of the voxel grid
    :voxel_size: float, the size of the voxels
    :ply_filename_out: string, path of the filename to save to
    This function adapted from: https://github.com/RobotLocomotion/spartan
    '''
    start_time = time.time()

    verts, faces, normals, values = np.zeros((0, 3)), np.zeros((0, 3)), np.zeros((0, 3)), np.zeros(0)
    try:
        verts, faces, normals, values = skimage.measure.marching_cubes(
            sdf_values, level=level, spacing=[voxel_size] * 3
        )
    except:
        pass

    # transform from voxel coordinates to camera coordinates
    # note x and y are flipped in the output of marching_cubes
    mesh_points = np.zeros_like(verts)
    mesh_points[:, 0] = voxel_grid_origin[0] + verts[:, 0]
    mesh_points[:, 1] = voxel_grid_origin[1] + verts[:, 1]
    mesh_points[:, 2] = voxel_grid_origin[2] + verts[:, 2]

    # apply additional offset and scale
    if scale is not None:
        mesh_points = mesh_points / scale
    if offset is not None:
        mesh_points = mesh_points - offset

    ##################
    if label is not None:
        label_points = np.transpose(label.nonzero())
        k_neigh = NearestNeighbors(n_neighbors=1)
        k_neigh.fit(label_points)
        indexes = k_neigh.kneighbors(mesh_points, return_distance=False).squeeze()

        co_label = label[tuple(np.transpose(label_points[indexes]))]
        classes = inv_map_lut[co_label]
        colors = color_map_lut[classes]
    ##################

    num_verts = verts.shape[0]
    num_faces = faces.shape[0]

    if label is not None:
        verts_tuple = np.zeros((num_verts,), dtype=[('x', 'f4'), ('y', 'f4'), ('z', 'f4'), ('red', 'u1'), ('green', 'u1'), ('blue', 'u1')])
        for i in range(0, num_verts):
            verts_tuple[i] = tuple(np.concatenate((mesh_points[i, :], colors[i, :]), axis=-1))
    else:
        verts_tuple = np.zeros((num_verts,), dtype=[("x", "f4"), ("y", "f4"), ("z", "f4")])
        for i in range(0, num_verts):
            verts_tuple[i] = tuple(mesh_points[i, :])

    faces_building = []
    for i in range(0, num_faces):
        faces_building.append(((faces[i, :].tolist(),)))
    faces_tuple = np.array(faces_building, dtype=[('vertex_indices', 'i4', (3,))])

    el_verts = plyfile.PlyElement.describe(verts_tuple, 'vertex')
    el_faces = plyfile.PlyElement.describe(faces_tuple, 'face')

    ply_data = plyfile.PlyData([el_verts, el_faces])
    logging.debug('saving mesh to %s' % (ply_filename_out))
    ply_data.write(ply_filename_out)

    logging.debug(
        'converting to ply format and writing to file took {} s'.format(
            time.time() - start_time
        )
    )

@click.command()
@click.option('--root', default="/gpfswork/rech/kvd/uyl37fq/data/semantic_kitti", help='path to dataset folder')
@click.option('--preprocess_root', default="/gpfsscratch/rech/kvd/uyl37fq/monoscene_preprocess/kitti", help='path to preprocess folder')
@click.option('--scale', default=1, help='drawing scale')
def main(root, preprocess_root, scale):
    data_module = KittiDataModule(
        root=root,
        preprocess_root=preprocess_root,
        batch_size=1,
        num_workers=3,
    )
    data_module.setup()
    model = MonoScene2.load_from_checkpoint("...")
    model.cuda()
    model.eval()
    dataloader = data_module.val_dataloader()

    cnt = 0
    for batch in dataloader:
        frame_id  = batch['frame_id'][0]
        filename = os.path.join("...", frame_id)
        batch['img'] = batch['img'].cuda()
        create_mesh(batch, model, filename, N=256 // scale)
        cnt += 1
        if cnt == 10:
            break

if __name__ == "__main__":
    main()

First of all, thank you very much for your reply.
Unfortunately,  this part of the code is not part of the SISC source code and still has problems after I modified it.
If y 发送 ou can search the source code of SISC, can you send me a copy? Thank you very much! If not, again, thank you for your help！
Also, congratulations, your article was included in cvpr2022
------------------ 原始邮件 ------------------
发件人: "Cao Anh @.>;
发送时间: 2022年9月23日(星期五) 下午2:49
收件人: @.>;
抄送: @.>; @.>;
主题: Re: [cv-rits/MonoScene] Can you help me in another paper? (Issue #24)
Hello,
it's really long time and I don't remember what was the problem but I found the code that I used. I hope it can help
#!/usr/bin/env python3 import logging import numpy as np import plyfile import skimage.measure import time import os from monoscene.models.monoscene2 import MonoScene2 from monoscene.data.semantic_kitti.kitti_dm import KittiDataModule import click def create_mesh(     batch, model, filename, N=256, max_batch=64 ** 3, offset=None, scale=None ):     start = time.time()     ply_filename = filename     voxel_origin = [0, 0, 0]     voxel_size = 1.0     model.eval()     sdf_values = model.get_discrete_sdf(batch, (N, N, N//8))     sdf_values = sdf_values.reshape((N, N, N//8))     sdf_values = np.abs(sdf_values)         end = time.time()     print("sampling takes: %f" % (end - start))     convert_sdf_samples_to_ply(         sdf_values,         voxel_origin,         voxel_size,         ply_filename + ".ply",         level=0.035,         offset=offset,         scale=scale,     ) def convert_sdf_samples_to_ply(     sdf_values,     voxel_grid_origin,     voxel_size,     ply_filename_out,         level,     label=None,     offset=None,     scale=None,     ):     '''     Convert sdf samples to .ply with semantic infomation     :param sdf_values: a numpy array of shape (n,n,n)     :voxel_grid_origin: a list of three floats: the bottom, left, down origin of the voxel grid     :voxel_size: float, the size of the voxels     :ply_filename_out: string, path of the filename to save to     This function adapted from: https://github.com/RobotLocomotion/spartan     '''     start_time = time.time()     verts, faces, normals, values = np.zeros((0, 3)), np.zeros((0, 3)), np.zeros((0, 3)), np.zeros(0)     try:         verts, faces, normals, values = skimage.measure.marching_cubes(             sdf_values, level=level, spacing=[voxel_size] * 3         )     except:         pass     # transform from voxel coordinates to camera coordinates     # note x and y are flipped in the output of marching_cubes     mesh_points = np.zeros_like(verts)     mesh_points[:, 0] = voxel_grid_origin[0] + verts[:, 0]     mesh_points[:, 1] = voxel_grid_origin[1] + verts[:, 1]     mesh_points[:, 2] = voxel_grid_origin[2] + verts[:, 2]     # apply additional offset and scale     if scale is not None:         mesh_points = mesh_points / scale     if offset is not None:         mesh_points = mesh_points - offset     ##################     if label is not None:         label_points = np.transpose(label.nonzero())         k_neigh = NearestNeighbors(n_neighbors=1)         k_neigh.fit(label_points)         indexes = k_neigh.kneighbors(mesh_points, return_distance=False).squeeze()         co_label = label[tuple(np.transpose(label_points[indexes]))]         classes = inv_map_lut[co_label]         colors = color_map_lut[classes]     ##################     num_verts = verts.shape[0]     num_faces = faces.shape[0]     if label is not None:         verts_tuple = np.zeros((num_verts,), dtype=[('x', 'f4'), ('y', 'f4'), ('z', 'f4'), ('red', 'u1'), ('green', 'u1'), ('blue', 'u1')])         for i in range(0, num_verts):             verts_tuple[i] = tuple(np.concatenate((mesh_points[i, :], colors[i, :]), axis=-1))     else:         verts_tuple = np.zeros((num_verts,), dtype=[("x", "f4"), ("y", "f4"), ("z", "f4")])         for i in range(0, num_verts):             verts_tuple[i] = tuple(mesh_points[i, :])     faces_building = []     for i in range(0, num_faces):         faces_building.append(((faces[i, :].tolist(),)))     faces_tuple = np.array(faces_building, dtype=[('vertex_indices', 'i4', (3,))])     el_verts = plyfile.PlyElement.describe(verts_tuple, 'vertex')     el_faces = plyfile.PlyElement.describe(faces_tuple, 'face')     ply_data = plyfile.PlyData([el_verts, el_faces])     logging.debug('saving mesh to %s' % (ply_filename_out))     ply_data.write(ply_filename_out)     logging.debug(         'converting to ply format and writing to file took {} s'.format(             time.time() - start_time         )     ) @click.command() @click.option('--root', default="/gpfswork/rech/kvd/uyl37fq/data/semantic_kitti", help='path to dataset folder') @click.option('--preprocess_root', default="/gpfsscratch/rech/kvd/uyl37fq/monoscene_preprocess/kitti", help='path to preprocess folder') @click.option('--scale', default=1, help='drawing scale') def main(root, preprocess_root, scale):     data_module = KittiDataModule(         root=root,         preprocess_root=preprocess_root,                         batch_size=1,         num_workers=3,     )         data_module.setup()     model = MonoScene2.load_from_checkpoint("...")     model.cuda()     model.eval()     dataloader = data_module.val_dataloader()          cnt = 0     for batch in dataloader:                        frame_id  = batch['frame_id'][0]         filename = os.path.join("...", frame_id)         batch['img'] = batch['img'].cuda()          create_mesh(batch, model, filename, N=256 // scale)         cnt += 1         if cnt == 10:             break if name == "main":     main()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

Hello,
Thanks! The only codes I use from them is this code to generate the mesh.
Traceback (most recent call last):
  File "main_ssc_a.py", line 1248, in <module>
    main()
  File "main_ssc_a.py", line 1244, in main
    visualize(opt, config, expr_path)
  File "main_ssc_a.py", line 1174, in visualize
    visualize_pipeline(D_Seg=D_Seg, D_SSC=D_SSC,
  File "main_ssc_a.py", line 1122, in visualize_pipeline
    iou_out = evals.scene_save_ssc_a(G_siren, shape_out[0], class_out, raw, label, mask, config, model_dir, indices[0])
  File "/home/SISC/evals.py", line 353, in scene_save_ssc_a
    convert_sdf_samples_to_ply(
  File "/home/SISC/evals.py", line 589, in convert_sdf_samples_to_ply
    indexes = k_neigh.kneighbors(mesh_points, return_distance=False).squeeze()
  File "/opt/conda/lib/python3.8/site-packages/sklearn/neighbors/_base.py", line 670, in kneighbors
    X = check_array(X, accept_sparse='csr')
  File "/opt/conda/lib/python3.8/site-packages/sklearn/utils/validation.py", line 63, in inner_f
    return f(*args, **kwargs)
  File "/opt/conda/lib/python3.8/site-packages/sklearn/utils/validation.py", line 669, in check_array
    raise ValueError("Found array with %d sample(s) (shape=%s) while a"
ValueError: Found array with 0 sample(s) (shape=(0, 3)) while a minimum of 1 is required.
Killing subprocess 258578
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/conda/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launch.py", line 340, in <module>
    main()
  File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launch.py", line 326, in main
    sigkill_handler(signal.SIGTERM, None)  # not coming back
  File "/opt/conda/lib/python3.8/site-packages/torch/distributed/launch.py", line 301, in sigkill_handler
    raise subprocess.CalledProcessError(returncode=last_return_code, cmd=cmd)
subprocess.CalledProcessError: Command '['/opt/conda/bin/python', '-u', 'main_ssc_a.py', '--local_rank=0', '--task=visualize', '--experiment_name=test-vis']' returned non-zero exit status 1.
------------------ 原始邮件 ------------------
发件人: "Cao Anh @.>;
发送时间: 2022年9月23日(星期五) 下午3:24
收件人: @.>;
抄送: @.>; @.>;
主题: Re: [cv-rits/MonoScene] Can you help me in another paper? (Issue #24)
Hello,
Thanks! The only codes I use from them is this code to generate the mesh. Btw, what is your problem?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

Hi! I am not Chinese, this seems to be errors in their code, I think you should ask them.
Maybe you already known, you can try to use pdb.set_trace() to debug the variables.

hi, Thank you very very very much!!!!
------------------ 原始邮件 ------------------
发件人: "Cao Anh @.>;
发送时间: 2022年9月23日(星期五) 下午3:31
收件人: @.>;
抄送: @.>; @.>;
主题: Re: [cv-rits/MonoScene] Can you help me in another paper? (Issue #24)
Hi! I am not Chinese, this seems to be errors in their code, I think you should ask them.
Maybe you already known, you can try to use pdb.set_trace() to debug the variables.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>

You're welcome. Sorry for not being able to help!

Thanks for the help from across the Atlantic！


#275 regulatory outline [Work in Progress]

Notes/questions:

When an issue is from another project, #275 in commit doesn't work.
Can/should we handle the lint/prettier pipeline in one command for all file types? (comparing to components/menu)
How can this be tested?
Is there a preferred templating engine that can be used to create markup and pull in data in this repo?
Are there css naming conventions? Preferred units?

Great questions!
We have a few spacing variables here https://github.com/cagov/design-system/blob/main/components/base-css/src/_variables.scss#L23 we should expand this set as we need more values so we can use standard spacing everywhere
Thanks for creating a separate template html file. I have a ticket to get that dynamically written into readmes so the markup isn't duplicated. We haven't setup our component gallery viewing system yet either yet but we can use the template HTML file there too.
The linting and prettier formatting commands and run hooks will get applied to the design-system repo as a whole. Right now there are still a lot of violations so need to fix them all before moving those commands outside of individual components.
When we write styles in our web components they are encapsulated by the custom element tag name which has a cagov- prefix.
When we create classnames that are applied outside of a custom element we can use the cagov- prefix to make them more unique like cagov-regulatory-outline
We have used https://every-layout.dev/ techniques in our design components already. I like how the W3C design system uses https://cube.fyi/ and think we should try to follow those patterns where they apply. That methodology isn't too prescriptive about class naming but helpful with organization. What do you think about CUBE CSS?

@aaronhans

Thanks for the reference to the custom properties in _variables.scss.  I tried testing that out for for regulatory outline on cannabis and I think the format for the spacing syntax needs to be  --margin-sm: calc(var(--spacing-base) * 6);
Should we assume the user is including @cagov/base-css when designing components?

Got it.

Will do.

Got it.

Will do.

a)  Looks like every-layout.dev requires a payment. Will follow up about that on a different thread.
b) I'm not familiar with CUBE but reading through the docs it makes sense. I like using utility classes and BEM is familiar.

base-css is going to be there in all our instances but shouldn't be a hard dependency. When we've used values defined in there before we reference the css variable in the separate component and define a fallback value like https://github.com/cagov/design-system/blob/main/components/pagination/src/css/index.scss#L15

Then reference any referenced CSS variables in the variables section of the readme

Thanks for checking this stuff out. I'll ask Chad to get the team access to every-layout. The W3C design system referenced that in their documentation along with CUBE CSS. Koji and I like how that approach tries to solve some responsive layout problems without media queries so it is worth reviewing.

Ready for review.


Fixed issue #11561

Q
A

Is bugfix?
yes

New feature?
no

Breaks BC?
no

Tests pass?
yes

Fixed issues
#11561

Looks good to me. @yiisoft/core-developers need extra review.

@SamMousa I think we need to fix exception hierarchy and then it's ready to me merged.

@samdark What exception hierarchy would you prefer?

https://github.com/yiisoft/yii2/pull/11562#discussion_r63163950

Ok, done!

One last thing: add an @throws NotInstantiableException since version 2.0.9, if a non-optional dependency could not be instantiated. tag to the method.
Also need a CHANGLOG ;)
sorry, did not notice these earlier.

Sorry I still don't have the habit of adding the changelog ;-)

Merged with adjustments: https://github.com/yiisoft/yii2/commit/dfa292652d94d014b7bd9ce399ee665e4d3b60de
Thank you!


Upgrade libxml to latest (0.17.1 breaks on node 6.x)

Also fixed lint issues in benchmark/parsers.js and lib/escape.js

Thanks


[Bug]: Multiselect is toggling when deleting single items

Tremor Version
3.7.1
Link to minimal reproduction
Tremor.com
Steps to reproduce
Select multiple items and then delete items one by one. The select options are toggling.
What is expected?
Keep the actual state (if open keep the menu open, if closed keep it closed)
What is actually happening?
It toggle
What browsers are you seeing the problem on?
No response
Any additional comments?
No response

The direction I would have taken, curious what you are thinking of @mbauchet
onClick={(e) => {
                              e.preventDefault();
                              const newValue = value.filter((v) => v !== option.props.value);
                              onValueChange?.(newValue);
                              setSelectedValue(newValue);
                            }}

I was exactly thinking about that! 😄
I'm actually on holliday without computer, so I can't do it before next weekend 😉


Chore(deps): hyper 1.0

Migrate to hyper 1.0
This migration should be opt-in through a feature flag. It would add :

A hyper::service::Service to the EngineIoService struct with an hyper::body::Incoming input type
A hyper::service::Service to the SocketIoService struct with an hyper::body::Incoming input type
A build_server() on the SocketIoBuilder to directly spawn a server, because from 1.0 hyper is dropign its Server struct in favour of manual implementation with a TcpListener
Change the body type from http-body 0.4 to http-body 1.0

Currently stuck because of https://github.com/salvo-rs/salvo/issues/468


fix #2741: add staging environment via NODE_ENV

Codecov Report

Merging #2742 into dev will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev    #2742      +/-   ##
==========================================
+ Coverage   99.91%   99.91%   +<.01%
==========================================
  Files          23       23
  Lines        1211     1213       +2
==========================================
+ Hits         1210     1212       +2
  Misses          1        1

Impacted Files
Coverage Δ

lib/builder/webpack/server.config.js
100% <ø> (ø)
:arrow_up:

lib/builder/webpack/client.config.js
100% <ø> (ø)
:arrow_up:

lib/core/renderer.js
100% <0%> (ø)
:arrow_up:

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 1582df1...13b74b8. Read the comment docs.

Thanks @PeterPanZH


cadvisor not exposing up metrics for all running containers and services

Hello All,
I am running docker-compose setup and using cadvisor to expose the container metrics but I don't see UP metrics is being written for all the containers.
Can you help?

Can you explain what you mean by UP metrics for containers?
https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md
Here's a list of all the cadvisor metrics that are written out, my advice would be if you want to check whether a container is up or down to check whether there is any memory in use like we have set in our alertmanager rules:
absent(container_memory_usage_bytes{name="jenkins"})

Can you explain what you mean by UP metrics for containers?
https://github.com/google/cadvisor/blob/master/docs/storage/prometheus.md
Here's a list of all the cadvisor metrics that are written out, my advice would be if you want to check whether a container is up or down to check whether there is any memory in use like we have set in our alertmanager rules:
absent(container_memory_usage_bytes{name="jenkins"})

Closing this issue due to inactivity if you still have a problem please request this to be reopened and respond to the question above.


[Feature Request] New client account by admin - Send account details

When creating a New Client account from the admin portal, the admin has to enter the clients details and password on behalf of the client. When a client account is setup in this way the client does not receive the Welcome email. This means the client does not know that an account has been created for them.

Add Checkbox "Send Client Welcome Email"  when creating a new client account from admin. This gives the admin the option not to send new account details.

Send Welcome email (admin initiated)

Welcome to Website Name. A Client account has been created on your behalf by a member of our team. Please use the link below to set your password.
Email address<EMAIL_ADDRESS>Password - Reset Password Link
If Verify Email address setting is activated, the client will be able to request to "Resend verification email" once they have reset their password and logged into their account.

Should be a pretty simple feature. Will look at it tomorrow. 👍


Typesafe config integration

For IOSystem and MetricSystem.
Still need to do Clients and Servers

Current coverage is 81.93%

Merging #348 into develop will decrease coverage by -0.77% as of 119fa24

@@            develop    #348   diff @@
=======================================
  Files            66      67     +1
  Stmts          3487    3537    +50
  Branches        505     513     +8
  Methods
=======================================
+ Hit            2884    2898    +14
  Partial           0       0
- Missed          603     639    +36

Review entire Coverage Diff as of 119fa24

Powered by Codecov. Updated on successful CI builds.

:+1:


[(Basic) Bookmarks] Create bookmark without confirmation step

Extension
https://www.raycast.com/rauno/bmrks
Description
Currently, the confirmation view (screenshot below) shows up when I run the "Create Bookmark" command with a keyboard shortcut.
I want to have an option to create a bookmark without having to confirm the group or link title.

Who will benefit from this feature?
Anyone who wants to create bookmarks faster with a single keyboard shortcut.
Anything else?
It can be implemented with a no-view^1 command that runs in the background and shows a message to inform the user of completion (or error) with the showHUD^2 api.

But which group would it save to?

But which group would it save to?

The last group used by the user or an option in the command preferences to set a default group.

Preferences can't have dynamic options unfortunately, and having it as a text field is too error prone
Defaulting to the last used group seems a bit random to me... I think this would only work if bmrks supported some sort of "inbox" approach, or an "all" category, where we could safely add bookmarks to, and then they can be moved
@raunofreiberg curious about your thoughts here

Preferences can't have dynamic options unfortunately, and having it as a text field is too error prone

The dynamic options could be exposed in a "preferences" page using a Form.Dropdown^1 component and the user settings can be saved in local storage^2.

Yeah, I think what Pedro was saying is that we can't fetch data in the preferences view to populate a dropdown. So you'd have to just manually fill in a text field with your group name (e.g. articles) which feels awkward. Do I have that right?

You're completely right, Raycast's Preferences API doesn't allow dynamic values and having a text field is just bad ui/ux.
I was talking about a Preferences page without using that api.

@raunofreiberg yeah you got that right
@navtoj yeah that would mean creating a new command. Some extensions do that, although it's just a workaround for the lack of dynamic preferences. This is on our list. I find that having these extra commands can be a bit overwhelming for people.
Im leaning towards the optimal solution being that bmrks supports the creation of bookmarks outside of a group, especially because other people have requested the ability to browse all bookmarks (pr here). But obviously that's a slight change on the product side, not sure how Rauno feels about this

Mm yeah, I think a catch-all category like you made in #10900 would be useful on the web interface.
Currently, you need to send a group_id when creating a bookmark but perhaps if we had an index view on the web, that's where we could send all bookmarks without a group ID.

@peduarte

I find that having these extra commands can be a bit overwhelming for people.

Hmm, in that case, what about just an ActionPanel.Submenu^1 to show the options instead of a whole separate command.
And, this could of course be deprecated when there is a change on the product side that allows for a non-group bookmark or a generic group.

If we can make this "all" category, then I guess we can just send all links there. If not, then we'd have to choose between a command or an action. I can see the benefit of assigning a hotkey and having your links automatically being saved!


Validate uniqueness is possible?

There is a way to validate uniqueness?
I thought in encrypt the new input of my field and try to search for it in the database, but seems that it wasn't working very well oO
Someone have an idea for validate uniqueness of a field?

Do you could help me please? oO @spikex

I'm afraid encryption and uniqueness don't mix. By design the encryption does not encrypt the same text the same way twice. If it did, it would be possible compare encrypted data making it much easier to crack.
So, you are not going to be able to use database uniqueness.
Probably your best bet would be to to store the a hash (say SHA-1) of the data you are encrypting in a different column and depend on it's uniqueness. Be sure to salt that hash, otherwise you are opening yourself up to a dictionary attack.

I see. Thanks =) @spikex


Update on Payment card number

Hello,
An update on Payment card number was released the 2021-10-09T19:02:06Z. Check for any new Issuer identification number edit. Link to the diff. Here is the summary:
Reverted edits by 2603:8001:5601:280B:2D5C:7836:63C6:F8 (talk) to last version by <IP_ADDRESS>

← Previous revision
Revision as of 19:02, 9 October 2021

Line 15:
Line 15:

−
== Issuer identification number (IIN) ==4115680177335521
+
== Issuer identification number (IIN) ==

[[Image:Credit card-first 4 digits.jpg|thumb|Partial IIN on a credit card (both printed and embossed)]]

[[Image:Credit card-first 4 digits.jpg|thumb|Partial IIN on a credit card (both printed and embossed)]]

The first six or eight digits of a card number (including the initial MII digit) are known as the issuer identification number (IIN). These identify the card issuing institution that issued the card to the card holder. The rest of the number is allocated by the card issuer. The card number's ''length'' is its number of digits. Many card issuers print the entire IIN and account number on their card.

The first six or eight digits of a card number (including the initial MII digit) are known as the issuer identification number (IIN). These identify the card issuing institution that issued the card to the card holder. The rest of the number is allocated by the card issuer. The card number's ''length'' is its number of digits. Many card issuers print the entire IIN and account number on their card.

If this Wikipedia's edit does not affect us, just ask for this issue to be close.
In case of trouble, ask for @aloisdg

Fix #71


Funky NavBar

Funky NavBar
Back in December, I used this template to setup a simple site. Back then, the navbar elements were all nicely lined up on the right hand side of the top navbar. Now, they seems to be kinda in the center and it just doesn't look as clean.
Here is an example of what it looks like now with the navbar just not looking quite right:

Thank you @prototypa so much for the quick response! Really love this theme and using it in a few places. I recently upgraded and wanted the right floating nav bar back and this should do exactly what I want. Thanks!


Please update to 1.19.4

I really like this MOD and have been using it for a long time
Hope to update to 1.19.4 soon
If possible, I can provide sponsorship for you to develop

Yes, I agree, please update to 1.19.4, in 1.19.4 they just fixed a bit of optimization so that some people will start updating to it

I am currently working on it. I still need to fix a bug in the SNBT editor.

I am currently working on it. I still need to fix a bug in the SNBT editor.

I thought you forgot

The mod has been updated to 1.19.4: https://github.com/skyecodes/IBE-Editor/releases/tag/2.2.2%2B1.19.4


Feat/add reencrypt keystore

Add ability to reencrypt keystores
Only major change is that a custom file path needs to be explicitly passed in with —path instead of args[1]. I did this because I didn’t think it was possible for a user to know that args[1] should be the path, but happy to revert to what it was if you think otherwise.
DRYed some logic that is now re-used b/c of new command

The reencryption works great
Some minor bugs
Issue 1:
Expected: Throw error after entering invalid current passphrase and not proceed to enter new passphrase
Actual: No error was thrown when entering invalid current passphrase and it proceeded to prompt for new passphrase

Issue 2:
Expected: Screen to not clear after reencrypting new passphrase.
Actual: Screen cleared after rencrypting new passphrase.

I think the screen should only clear when showing the mnemonic. The screen should not clear when reencrypting. It should not show the 'press enter to exit' prompt.  It should only show the 'reencryption is complete' log and behave similar to decrypt command.

I agree with all comments. They've been resolved in ef6b0199ea112dd3eeddab2e1ac0ea575adb2fda. Docs have been updated.

@shanefontaine the updates work great 👍


feat: Add module metadata injection

Closes #323
This PR:

Adds moduleMetadata to _experiments option
Adds an optional plugin for injecting module metadata
Only adds plugin when it exists and moduleMetadata has been set
Adds an implementation for the webpack plugin

This PR does not yet pass through entryPoint to the metadata callback as suggested here.

[x] Needs tests!

The newly added e2e tests pass on my machine...

The newly added e2e tests pass on my machine but don't run in CI from my fork...

Ah we disabled E2E tests since we introduced debug IDs since the ones we had didn't make sense anymore.
Lemme look into this...

we disabled E2E tests since we introduced debug IDs since the ones we had didn't make sense anymore

My assumption was that e2e tests are disabled for PRs from external forks since an auth token is used for the basic_upload test.

we disabled E2E tests since we introduced debug IDs since the ones we had didn't make sense anymore

My assumption was that e2e tests are disabled for PRs from external forks since an auth token is used for the basic_upload test.

That too!


Error with adding IPv6 CIDR Rules to Security Group

I see the following error when mocking the authorization of an IPv6 address block in a security group:
$ python test.py
python version: 3.6.3 (v3.6.3:2c5fed86e0, Oct  3 2017, 00:32:08)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
moto version: 1.3.3
boto3 version: 1.7.33
botocore version: 1.10.33
Traceback (most recent call last):
  File "test.py", line 25, in <module>
    exit(main())
  File "/path/package/lib/python3.6/site-packages/moto/core/models.py", line 71, in wrapper
    result = func(*args, **kwargs)
  File "test.py", line 16, in main
    {"CidrIpv6": "2607:fb10::/32"}]}],
  File "/path/package/lib/python3.6/site-packages/botocore/client.py", line 314, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/path/package/lib/python3.6/site-packages/botocore/client.py", line 599, in _make_api_call
    operation_model, request_dict)
  File "/path/package/lib/python3.6/site-packages/botocore/endpoint.py", line 148, in make_request
    return self._send_request(request_dict, operation_model)
  File "/path/package/lib/python3.6/site-packages/botocore/endpoint.py", line 177, in _send_request
    success_response, exception):
  File "/path/package/lib/python3.6/site-packages/botocore/endpoint.py", line 273, in _needs_retry
    caught_exception=caught_exception, request_dict=request_dict)
  File "/path/package/lib/python3.6/site-packages/botocore/hooks.py", line 227, in emit
    return self._emit(event_name, kwargs)
  File "/path/package/lib/python3.6/site-packages/botocore/hooks.py", line 210, in _emit
    response = handler(**kwargs)
  File "/path/package/lib/python3.6/site-packages/botocore/retryhandler.py", line 183, in __call__
    if self._checker(attempts, response, caught_exception):
  File "/path/package/lib/python3.6/site-packages/botocore/retryhandler.py", line 251, in __call__
    caught_exception)
  File "/path/package/lib/python3.6/site-packages/botocore/retryhandler.py", line 269, in _should_retry
    return self._checker(attempt_number, response, caught_exception)
  File "/path/package/lib/python3.6/site-packages/botocore/retryhandler.py", line 317, in __call__
    caught_exception)
  File "/path/package/lib/python3.6/site-packages/botocore/retryhandler.py", line 223, in __call__
    attempt_number, caught_exception)
  File "/path/package/lib/python3.6/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
    raise caught_exception
  File "/path/package/lib/python3.6/site-packages/botocore/endpoint.py", line 222, in _get_response
    proxies=self.proxies, timeout=self.timeout)
  File "/path/package/lib/python3.6/site-packages/botocore/vendored/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/path/package/lib/python3.6/site-packages/responses.py", line 572, in unbound_on_send
    return self._on_request(adapter, request, *a, **kwargs)
  File "/path/package/lib/python3.6/site-packages/responses.py", line 548, in _on_request
    match.get_response(request), )
  File "/path/package/lib/python3.6/site-packages/moto/core/models.py", line 137, in get_response
    result = self.callback(request)
  File "/path/package/lib/python3.6/site-packages/moto/core/utils.py", line 172, in __call__
    result = self.callback(request, request.url, request.headers)
  File "/path/package/lib/python3.6/site-packages/moto/core/responses.py", line 116, in dispatch
    return cls()._dispatch(*args, **kwargs)
  File "/path/package/lib/python3.6/site-packages/moto/core/responses.py", line 199, in _dispatch
    return self.call_action()
  File "/path/package/lib/python3.6/site-packages/moto/core/responses.py", line 273, in call_action
    response = method()
  File "/path/package/lib/python3.6/site-packages/moto/ec2/responses/security_groups.py", line 67, in authorize_security_group_ingress
    self.ec2_backend.authorize_security_group_ingress(*args)
  File "/path/package/lib/python3.6/site-packages/moto/ec2/models.py", line 1562, in authorize_security_group_ingress
    group, group.get_number_of_ingress_rules(),
AttributeError: 'NoneType' object has no attribute 'get_number_of_ingress_rules'

Here's a simple script to repo:
import json, boto3, sys, moto, botocore

@moto.mock_ec2
def main():
    print('python version:', sys.version)
    print('moto version:', moto.__version__)
    print('boto3 version:', boto3.__version__)
    print('botocore version:', botocore.__version__)

    client = boto3.client('ec2', 'us-east-1')
    _id = 'sg-123abc'
    client.authorize_security_group_ingress(
        GroupId=_id, IpPermissions=[{"IpProtocol": "-1", "Ipv6Ranges": [ {"CidrIpv6": "fe80::/10"}]}],
    )

    response = client.describe_security_groups(GroupIds=[_id])
    print(json.dumps(response, indent=4))

if __name__ == '__main__':
    exit(main())

It looks like the issue is that the security group hasn't been created. You'll need to create it and pass the returned security group id.
Now, we obviously shouldn't throw an error like that. I'm guessing the right behavior is some type of 400 response.

A warning that the security group hasn't been created is now implemented as of moto >= 2.0.3.dev13


Resource execute rights problem

This might be a misunderstanding from my part, but the current behavior seems weird enough to justify a bug report.
Version:
Chef: 11.16.4
Environment:
CentOS 6.5 x86_64
Scenario:
In the real case scenario, I run a command via the execute resource as user git and as group git. This command connects to a redis database via a socket. This socket has owner redis and group redis and the file permissions are srwxrwx--- (0770).
The user git is a member of group redis so it has access to socket file. When I converge my node, it fails running the execute recipe saying permission denied on the socket file. However, when I log in as git and run the exact same command, it works.
Steps to Reproduce:
I created a trimmed down recipe file that can be run using chef-apply to reproduce the problem. In this recipe, user git is renamed to user1 (and group user1) while user redis is renamed to user2 (and group user2).
# File recipe.rb
group "user1"
group "user2"

user "user1" do
  gid "user1"
end

user "user2" do
  gid "user2"
end

group "user1" do
  action :modify
  members ["user1"]
  append true
end

group "user2" do
  action :modify
  members ["user1", "user2"]
  append true
end

file "/tmp/testfile" do
  user "user2"
  group "user2"
  mode "0440"
end

execute "user1 reads file with owner user2 and group user2 with mode 0440" do
  command "cat /tmp/testfile"
  user "user1"
  group "user1"
end

Then simply run chef-apply recipe.rb as user root (so you can create required users and groups).
Expected Result:
I would have expected the command to run successfully without a permission denied problem since it runs as user user1, user1 is a member of group user2 and file mode is 0440.
Actual Result:
A permission denied is instead encountered when applying the recipe.rb cookbook and the chef run fails.
$ chef-apply recipe.rb
(output removed)

---- Begin output of cat /tmp/testfile ----
STDOUT:
STDERR: cat: /tmp/testfile: Permission denied
---- End output of cat /tmp/testfile ----
Ran cat /tmp/testfile returned 1

Full output
cat /var/chef/cache/chef-stacktrace.out
Best regards,
Matt

Part of this issue was moved to #87 and part to #2347, so I'm closing this issue.


New-BcContainerWizard has a missing space in Version option d

just a tiny cosmetic bug :-)
BcContainerHelper version 4.0.1

Shipped in 4.0.3