text:
Question - how to build falcon with cython using pipenv

This is a cross post from stack overflow - https://stackoverflow.com/questions/48805350/how-to-build-falcon-with-cython-using-pipenv
In the  falcon docs it is mentioned that in order to build falcon with cython the following commands need to be issued:

$ pip install cython

$ pip install --no-binary :all: falcon

The question is how to do this with pipenv.
First of all i want to say Pipfile that i have build dependency cython.
I want also to pass the parameters --no-binary :all: falcon to pip.
How can i accomplish this with pipenv?

I actually had to do this for psycopg2 the other day; use this as a guide: https://github.com/pypa/pipenv/issues/1430

Hi @dfee,
I just want to be sure that we accomplish the goals for which we decided to uses pipenv.
When installing an environment from scratch just from Pipfile and Pipfile.lock will the module installed again with cython without setting the PIP_NO_BINARY environment variable?
If not, then i will have to set it up manually every time i install an environment, furthermore this flag would then be globally for all dependencies and not just for falcon.
Thanks

Hey @david-gang - that is a valid question, one I don’t have the answer to.

$ pipenv --three
$ pipenv run pip install Cython
$ pipenv install

I don't think it works for me:
First i run:

pipenv run pip install Cython
Collecting Cython
Downloading Cython-0.27.3-cp36-cp36m-manylinux1_x86_64.whl (3.1MB)
100% |████████████████████████████████| 3.1MB 340kB/s
Installing collected packages: Cython
Successfully installed Cython-0.27.3

Then i try to install falcon with cython:

export PIP_NO_BINARY=ALL && pipenv install falcon
Installing falcon…
Collecting falcon
Using cached falcon-1.4.1-py2.py3-none-any.whl
Requirement already satisfied: six>=1.4.0 in /home/david/.local/share/virtualenvs/planner->FTV5fq3F/lib/python3.6/site-packages (from falcon)
Collecting python-mimeparse>=1.5.2 (from falcon)
Using cached python_mimeparse-1.6.0-py2.py3-none-any.whl
Installing collected packages: python-mimeparse, falcon
Successfully installed falcon-1.4.1 python-mimeparse-1.6.0

Adding falcon to Pipfile's [packages]…
Pipfile.lock (712601) out of date, updating to (b17002)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…

Look he just took the wheel

Found out you can specify build-system requirements which will install cython and make it available for "normal" modules.
[build-system]
requires = ["cython"]

authors: david-gang dfee kennethreitz paulmwatson

repo: pypa/pipenv


text:
pipenv does not use default python version under pyenv

Issue description
The pipenv documentation states this:

If you don’t specify a Python version on the command–line, either the [requires] python_full_version or python_version will be selected automatically, falling back to whatever your system’s default python installation is, at time of execution.

However with 2020.06.02 I'm seeing pipenv choose the most recent pyenv installed python rather than the one that's current the default when I run pipenv install.
Expected result
Python version is 3.7.7 as set by .python-version via pyenv. I've verified that pipenv is installed and running from 3.7.7. I start a new project with pipenv install and I expect to see a virtual environment created with Python version 3.7.7.
artlogic@wardenclyffe:~/Code/random/pipenv-again$ python -V
Python 3.7.7
artlogic@wardenclyffe:~/Code/random/pipenv-again$ pipenv --support
<details><summary>$ pipenv --support</summary>

Pipenv version: `'2020.6.2'`

Pipenv location: `'/home/artlogic/.pyenv/root/versions/3.7.7/lib/python3.7/site-packages/pipenv'`

Python location: `'/home/artlogic/.pyenv/root/versions/3.7.7/bin/python3.7'`

Actual result
pipenv uses a different pyenv installed python to create the venv:
artlogic@wardenclyffe:~/Code/random/pipenv-again$ pipenv install -v requests
Using python: None
Path to python: /home/artlogic/.pyenv/root/versions/3.8.2/bin/python3
Creating a virtualenv for this project…
Pipfile: /home/artlogic/Code/random/pipenv-again/Pipfile
Using /home/artlogic/.pyenv/root/versions/3.8.2/bin/python3 (3.8.2) to create virtualenv…

Steps to replicate

Install two versions of python using pyenv (3.7.7 and 3.8.3).
Make a project directory and type: pyenv local 3.7.7 (verify you're now using 3.7.7)
Install pipenv: pip install pipenv
Install a dependency: pipenv install requests
Watch the virtualenv get created with 3.8.3.

$ pipenv --support
Pipenv version: '2020.6.2'
Pipenv location: '/home/artlogic/.pyenv/root/versions/3.7.7/lib/python3.7/site-packages/pipenv'
Python location: '/home/artlogic/.pyenv/root/versions/3.7.7/bin/python3.7'
Python installations found:

3.8.2: /home/artlogic/.pyenv/root/versions/3.8.2/bin/python3
3.7.7: /home/artlogic/.pyenv/root/versions/3.7.7/bin/python3
3.7.7: /home/artlogic/.pyenv/root/versions/3.7.7/bin/python3.7m
3.7.7: /home/artlogic/.pyenv/root/versions/3.7.7/bin/python3.7
3.7.7: /home/artlogic/.pyenv/root/versions/3.7.7/bin/python3
3.7.5: /home/artlogic/.pyenv/root/versions/3.7.5/bin/python3
3.7.4: /home/artlogic/.pyenv/root/versions/3.7.4/bin/python3
3.7.3: /home/artlogic/.pyenv/root/versions/3.7.3/bin/python3
3.7.2: /home/artlogic/.pyenv/root/versions/3.7.2/bin/python3
3.7.0: /home/artlogic/.pyenv/root/versions/3.7.0/bin/python3
3.6.3: /home/artlogic/.pyenv/root/versions/3.6.3/bin/python3
3.6.1: /home/artlogic/.pyenv/root/versions/3.6.1/bin/python3
3.5.4: /home/artlogic/.pyenv/root/versions/3.5.4/bin/python3
3.5.3: /usr/bin/python3
3.5.3: /usr/bin/python3.5
3.5.3: /usr/bin/python3.5m
2.7.15: /home/artlogic/.pyenv/root/versions/2.7.15/bin/python2
2.7.14: /home/artlogic/.pyenv/root/versions/2.7.14/bin/python2
2.7.13: /usr/bin/python2
2.7.13: /usr/bin/python2.7

PEP 508 Information:
{'implementation_name': 'cpython',
 'implementation_version': '3.7.7',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.9.0-12-amd64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Debian 4.9.210-1 (2020-01-20)',
 'python_full_version': '3.7.7',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

CLUTTER_IM_MODULE
PIPENV_VENV_IN_PROJECT
NVM_DIR
LS_COLORS
XDG_MENU_PREFIX
LANG
GDM_LANG
DISPLAY
PYENV_ROOT
OLDPWD
COLORTERM
NVM_CD_FLAGS
USERNAME
PYENV_VIRTUALENV_INIT
PYENV_HOOK_PATH
XDG_VTNR
SSH_AUTH_SOCK
XDG_SESSION_ID
USER
PYENV_DIR
DESKTOP_SESSION
RBENV_SHELL
QT4_IM_MODULE
QT_QPA_PLATFORMTHEME
PWD
HOME
JOURNAL_STREAM
SSH_AGENT_PID
PYENV_VERSION
QT_ACCESSIBILITY
XDG_SESSION_TYPE
XDG_DATA_DIRS
XDG_SESSION_DESKTOP
GJS_DEBUG_OUTPUT
GTK_MODULES
WINDOWPATH
VTE_VERSION
TERM
SHELL
RBENV_ROOT
QT_IM_MODULE
XMODIFIERS
NVM_BIN
XDG_CURRENT_DESKTOP
GPG_AGENT_INFO
QT_LINUX_ACCESSIBILITY_ALWAYS_ON
XDG_SEAT
SHLVL
PYENV_SHELL
WINDOWID
GDMSESSION
GNOME_DESKTOP_SESSION_ID
LOGNAME
DBUS_SESSION_BUS_ADDRESS
XDG_RUNTIME_DIR
XAUTHORITY
PATH
NVM_INC
GJS_DEBUG_TOPICS
SESSION_MANAGER
GTK_IM_MODULE
PIP_DISABLE_PIP_VERSION_CHECK
PYTHONDONTWRITEBYTECODE
PIP_SHIMS_BASE_MODULE
PIP_PYTHON_PATH
PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

PIPENV_VENV_IN_PROJECT: 1

Debug–specific environment variables:

PATH: /home/artlogic/.pyenv/root/versions/3.7.7/bin:/home/artlogic/.pyenv/root/libexec:/home/artlogic/.pyenv/root/plugins/python-build/bin:/home/artlogic/.rbenv/root/shims:/home/artlogic/.rbenv/root/bin:/home/artlogic/.rbenv/ruby-build/bin:/home/artlogic/.pyenv/pyenv-virtualenv/shims:/home/artlogic/.pyenv/root/shims:/home/artlogic/.pyenv/root/bin:/home/artlogic/.pyenv/pyenv-virtualenv/bin:/home/artlogic/.dotfiles/config/.nvm/versions/node/v12.16.3/bin:/home/artlogic/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
SHELL: /bin/bash
LANG: en_US.UTF-8
PWD: /home/artlogic/Code/random/pipenv-again

I am also seeing this behavior. It seems pipenv is using my system python (3.8.x) instead of my pyenv default python (3.6.x).

Yes, Pipenv uses a different finding approach that the highest version goes first. You can anyway pass the python version by pipenv install --python=3.7.

Yes, Pipenv uses a different finding approach that the highest version goes first. You can anyway pass the python version by pipenv install --python=3.7.

Are you saying this was an intentional change and the documentation is out of date?

Yes, it is not accurate

Would you accept a PR to update the docs for the time being?
This does feel like a bit of a UX regression to me. I found it very unexpected that pipenv chose a python that wasn't my current default to make the virtualenv. If you wouldn't mind, what's the rationale behind this change?

Yes, Pipenv uses a different finding approach that the highest version goes first. You can anyway pass the python version by pipenv install --python=3.7.

Please change this behaviour. It is very unexpected. When you specify --python 3.8 it can happen on MacOS, that it uses 3.8.4 from homebrew instead of the 3.8.3 from pyenv. Pyenv can lag a bit, but homebrew changes the default python version and removes the previous one without any warning, which is why many of us use pyenv, so they have control over the versions installed and know when to update virtualenvs at their own pace.
It also goes against the notion of python3.8 -m <module> where one expects the module to use the python version of that it is installed in. It technically does, but it's unexpected that it switches versions for virtual env selection.

Last but not least, pinning my Pipfile to a version gets trickled to source repositories, which then trickles to CI/CD pipefiles and complicates that workflow, when a CI tests against multiple python versions. One normally would use pipenv --deploy, but that won't work if Pipfile is pinned against a specific version.

This seems to be no longer true, since --python option only writes to Pipfile when it creates one, not when one already exists. But to add to confusion, it writes python_version = "3.8" when using --python 3.8.3, so pipenv --rm && pipenv install will now select a different version :(

It would be great if the docs were updated to reflect how pipenv picks a default python to remove the confusion :)
In my case pipenv picked the python version installed by homebrew at /usr/local/bin/python3 which is not the default python on my system when I call which python.
Since I use pyenv to set / manage the default python on my system, I found a relatively painless workaround by adding the below in my .zprofile:
export PIPENV_DEFAULT_PYTHON_VERSION=$(pyenv which python)

PIPENV_DEFAULT_PYTHON_VERSION is not being respected for me despite being set.
Instead, I have to do pipenv --python $(pyenv which python)  every time which is quite frustrating. Using 2020.11.15.

@vylmen @artlogic PRs are always welcome

I recognize this frustration, however, I worked around it by having alias pipenv='pipenv --python=$(which python)' in my profile, as the PIPENV_DEFAULT_PYTHON_VERSION was not respected all of the time.

I'm curious to know how you've install pipenv? From their documentation, it is NOT recommended that you use an external package manager such as Homebrew, but instead to use pipx. This is further complicated with the use of virtual environments. The way I got this to work is:

Installed my virtual environments using pyenv.
Integrated pyenv into my shell RC script.
Set my pyenv global X.Y to point to the correct python version.
pip install --user pipx
python -m pipx ensurepath <- we can't yet reference pipx from our $PATH until we run this.
pipx install pipenv <- you'll need to run this for every virtual environment you need pipenv support.

I'm curious to know how you've install pipenv? From their documentation, it is NOT recommended that you use an external package manager such as Homebrew, but instead to use pipx. This is further complicated with the use of virtual environments. The way I got this to work is:

Installed my virtual environments using pyenv.
Integrated pyenv into my shell RC script.
Set my pyenv global X.Y to point to the correct python version.
pip install --user pipx
python -m pipx ensurepath <- we can't yet reference pipx from our $PATH until we run this.
pipx install pipenv <- you'll need to run this for every virtual environment you need pipenv support.

this guy knows his stuff.

I'm curious to know how you've install pipenv? From their documentation, it is NOT recommended that you use an external package manager such as Homebrew, but instead to use pipx. This is further complicated with the use of virtual environments. The way I got this to work is:

Installed my virtual environments using pyenv.
Integrated pyenv into my shell RC script.
Set my pyenv global X.Y to point to the correct python version.
pip install --user pipx
python -m pipx ensurepath <- we can't yet reference pipx from our $PATH until we run this.
pipx install pipenv <- you'll need to run this for every virtual environment you need pipenv support.

Bit late with my reaction, but the mail from akinowilson reminded me. My installation is very similar. Pyenv is installed with homebrew, installed in shell rc, version set globally. Pip then installes both pipx and pipenv.
No issues with that setup.

I am not sure why the documentation references pipx  -- pipenv can be installed fine using pip these days and pipenv uses the vendor'd version of pip.   I guess I would like to know if this is still an issue on the latest version pipenv==2022.8.19?

source: gharchive/issue

authors: akinolawilson artlogic emkman frostming kolaworld matteius ms-lolo vylmen wmkuipers xirkus

license: MIT

license_type: permissive

license_source: github-api


text:
Is pulling semver and iso8601needed?

Issue description
Is pulling semver and iso8601 needed?
I am going through the list of pipenv dependencies for testing purposes in Fedora.
When looking for ways to invoke functionalities of the vendored libraries I realized, nothing really imports semver.
pipenv/vendor/distlib uses some semver matching, but it has no connection to the actual library.
semver is imported in tests/test_artifacts/git/pinax/check.py where it seems it's isolated from the production code - alongside with github3 or tabulate which are also not vendored. I guess (as I don't know the codebase that much) that wherever the artifacts are used, they are isolated and pull the needed libraries from the internet resources.
To check the hypothesis I've removed semver and rerun tests with the same good results as before.
I assume it may be safely removed, but I may have overlooked something.
Another thing is bundling iso8601 which is not used anywhere. pyparsing.py uses iso8601_date and iso8601_datetime, but they're defined there, not imported from the library. The whole library seems unused and safe to remove.
If this line of thoughts is correct, I can send a PR with the changes.

@befeleme Your assessment makes sense to me, please feel free to open a PR for this.

authors: befeleme matteius


text:
Minor corrections to the Entry Points page

Summary of changes
Hi @abravalheri, these are a few minor issues with the previous PR (#3355) that I just happened to notice. Apologies for not noticing these before, I hope these can be merged soon.
Pull Request Checklist

[x] News fragment added in changelog.d/.
(See documentation for details)

There are two other points that I just noticed (again, sorry for not noticing these before):

The last section of the Entry Points page, which refers to extra dependencies for entry points, seems to be a deprecated functionality according to the Dependencies Management docs page. The relevant sections (on defining Extra Dependencies) in both pages seem to link to each other and share similar content, so perhaps it would be a good idea to make appropriate modifications to both pages? I wasn't sure how you would like to go about this, hence wanted your feedback first before making any changes.
This point is regarding the syntax for defining entry points in the Console Scripts section. Assuming that the parts in square brackets are supposed to stand for things that are optional, it seems that the "module" part is compulsory. However in all of our examples in this page, we have been defining functions corresponding to entry points in the __init__.py file of the package, and therefore referring to the function without any module name, like timmins:hello_world. This might be confusing for some users... maybe we should modify the way this syntax has been specified?

Thank you very much for the awesome improvements @codeandfire (and the level to attention to the details!).
I think we can merge these changes immediately: differently from changes in the setuptools code, the documentation changes are picked up immediately by ReadTheDocs and published as latest, so we don't need to create a tag release for them.
Regarding your suggestions:

Considering that we already have this part covered in a different document, and that this practice is deprecated (or at least pip does not honour it and we want to manage user's expectation), I believe we can remove the "Dependency Management" section from the Entry Points page. What do you think?

Yeah maybe the way we define the syntax is a bit confusing. The way I see it is that everything before the : is what you would write in an import (or from import statement).
What do you think about the following:
The syntax for entry points is specified as follows (``[]`` denotes optionality and ``*`` repetition)::

    <name> = <package_or_module>[:<object>[.<attr>[.<nested_attr>]*]

where ``name`` is the name for the script you want to create, the left hand side of ``:`` is the
package or module that contains your function and the right hand side is the object you want to
invoke (e.g. a function).

When parsing this syntax, you can imagine that tools in the Python ecosystem will use the
entry point value in a way that is roughly equivalent to:

1. ``<package_or_module>`` only (can contain ``.`` in the case of sub-modules or sub-packages)::

     import <package_or_module>
     parsed_value = <package_or_module>

2. ``<package_or_module>:<object>`` (``<object>`` does not contain ``.``)::

     from <package_or_module> import <object>
     parsed_value = <object>

3. ``<package_or_module>:<object>.<attr>.<nested_attr>``::

     from <package_or_module> import <object>
     parsed_value = <object>.<attr>.<nested_attr>

(Please feel free to ignore the suggestion or modify it).

Thanks for your response @abravalheri! It does make a lot of sense to entirely remove the Dependency Management section from the Entry Points page. And I think the layout you have suggested for explaining the syntax bit makes things really clear. I'll amend this PR then, to incorporate these changes, and then perhaps we can merge.

@abravalheri have added all changes. Let me know your feedback! Thanks!

Thank you very much @codeandfire! I will go ahead and merge this.
On a side note, I am also working in some other improvements (motivated by all the good work you have been doing), and, I that is OK with you, I might ask your opinion on that (since you are already involved in the recent documentation changes).

Sure @abravalheri, would love to be of any help!

source: gharchive/pull-request

authors: abravalheri codeandfire

repo: pypa/setuptools

license: mit

license_source: bigquery


text:
visuspy

I'm getting the following error (file-size policy limit):
HTTPError: 400 Client Error: File too large. Limit for project 'visuspy' is 60 MB. See https://pypi.org/help/#file-size-limit for url: https://upload.pypi.org/legacy/
could you increase this limit for visuspy project? I'm expecting file size to be <100MB

Hi @scrgiorgio, I'm not seeing any projects named visuspy. If this is the first time you're making a release, you'll need to make a throwaway release that's under the 60MB limit before we can increase the limit.
Also, could you give some background on the package and why it needs a larger distribution size?

Hi the project name is now openvisus. I'm pretty sure that for some
platforms it can reach 60+MB. Would it be possible to add it as an
exception for big Data project? Please look for visus/ Pascucci on the web
to understand what it will be inside... Thanks Giorgio scorzelli.
Il mer 4 lug 2018, 16:44 Dustin Ingram notifications@github.com ha
scritto:

Hi @scrgiorgio https://github.com/scrgiorgio, I'm not seeing any
projects named visuspy. If this is the first time you're making a
release, you'll need to make a throwaway release that's under the 60MB
limit before we can increase the limit.
Also, could you give some background on the package and why it needs a
larger distribution size?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/pypa/warehouse/issues/4196#issuecomment-402499207,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABM8vy9BGfQRTPdYo_N2jrGuk1KrfS_1ks5uDNS_gaJpZM4UtB0R
.

This is a bit old and it seems like the openvisus project has been making releases without problems, so I'm going to close this, but feel free to reopen if this is still necessary.

if it was possible to increase the size to 100mb.
We had to remove some files from the pip in order to upload it.
Thanks.

Hi @scrgiorgio, I'm happy to do this if you can give me some details about what file this project needs to include that make it so large, and why.
You might also want to add a description to https://pypi.org/project/OpenVisus/, it's difficult for me to understand what this project is for.

Hi,
Visus is a very mature and complex project for exploring huge datasets.
We released it to open source just few months ago (we didn't have much time
to show off it since we are still in the bug-fixing phase).
Maybe this paper best describes what it does:
https://pdfs.semanticscholar.org/614b/68225a84e9d134eb37a925cf6917d6d35af5.pdf
The wheel is so huge because we use a mix of C++ and python.
We embed and extend python using the same libraries (which I think it's
pretty cool and innovative).
You can start Visus Viewer and run an embedded python interpreter 'inside'.
Python will help the viewer to transform data using for example OpenCV
and/or numpy.
Or you can run the python interpreter (in the usual/common way) and then
run from there the VisusViewer and 'drive' it using the SWIG automatically
generated API.
The wheels contains a lot of documentation, examples, scripts, sample
datasets etc.
And also the libraries are multiple and 'fat': from Kernel, to multi
dimensional viewing, to Dataflow, to Gpu computation etc.
Also for Windows we switch a lot from Release to Debug and we need to
distribute also the *.pdb (debug symbols).
That's the reason why the wheels are so big.
Thanks again for your help.
Giorgio.
Il giorno mer 12 set 2018 alle ore 18:37 Dustin Ingram <
notifications@github.com> ha scritto:

Hi @scrgiorgio https://github.com/scrgiorgio, I'm happy to do this if
you can give me some details about what file this project needs to include
that make it so large, and why.
You might also want to add a description to
https://pypi.org/project/OpenVisus/, it's difficult for me to understand
what this project is for.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/pypa/warehouse/issues/4196#issuecomment-420715510,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABM8v2VDpjRK8vLIEtESSPgUKX3o2mS_ks5uaThYgaJpZM4UtB0R
.

Thanks for the explanation. I've increased the limit for openvisus to 100MB on PyPI.

authors: di scrgiorgio

repo: pypa/warehouse


text:
Switch to using the "system font stack"

This is a first attempt to close #8634 by switching to a system font stack.
Should I put a line break for the list of fonts? I ran make reformat hoping it would sort out my formatting issues but no luck :D

I copied меншого to before the <em> tag to make it easier to compare (that is why it appears twice). I think it now uses the same font.
What should I do next? Are there things that can be cleaned up now that Source Sans Pro isn't in use any more?
Are there any conventions around adding [WIP] to the PR title or marking it as draft for stuff which needs a bit of hand-holding from an experienced person?

I think it now uses the same font.

Have you checked this with DevTools? The italics version seems visually smaller which suggests that the font may still be different.

Should I put a line break for the list of fonts? I ran make reformat hoping it would sort out my formatting issues but no luck :D

I don't think it knows how to format CSS. I guess you can change it any way you want as long as it remains readable.

Are there any conventions around adding [WIP] to the PR title or marking it as draft for stuff which needs a bit of hand-holding from an experienced person?

I think you can mark PRs as Draft when you yourself think that it's not ready for review.
P.S. I don't think I currently have the warehouse repo set up on my laptop but I've made this change via DevTools on the production instance. And in my env, it now selects Arial for both normal paragraph text and the emphasized one.

I think it now uses the same font.

Have you checked this with DevTools? The italics version seems visually smaller which suggests that the font may still be different.

Should I put a line break for the list of fonts? I ran make reformat hoping it would sort out my formatting issues but no luck :D

I don't think it knows how to format CSS. I guess you can change it any way you want as long as it remains readable.

Are there any conventions around adding [WIP] to the PR title or marking it as draft for stuff which needs a bit of hand-holding from an experienced person?

I think you can mark PRs as Draft when you yourself think that it's not ready for review.
P.S. I don't think I currently have the warehouse repo set up on my laptop but I've made this change via DevTools on the production instance. And in my env, it now selects Arial for both normal paragraph text and the emphasized one.

Devtools for the two bits of text below. I think this means they are using the same font (not quite sure why FA shows up for the normal text)

This is with firefox on OSX

Devtools for the two bits of text below. I think this means they are using the same font (not quite sure why FA shows up for the normal text)

This is with firefox on OSX

As far as I can tell this is ready for reviewing. System font stack is used for all normal text (normal == not monospaced).

As far as I can tell this is ready for reviewing. System font stack is used for all normal text (normal == not monospaced).

Thanks @betatim for taking a look at this!

Are there things that can be cleaned up now that Source Sans Pro isn't in use any more?

Looks like it's still in use by the admin interface CSS as well as some SVG logos and other templates.
I'd be fine with dropping it in all those places and removing our dependency on fonts.google.com for all Warehouse pages (except our 404 page, this should remain).
However I'll leave this for @nlhkabu to approve since ultimately it has the effect of changing the font all of PyPI will render with.

Thanks @betatim for taking a look at this!

Are there things that can be cleaned up now that Source Sans Pro isn't in use any more?

Looks like it's still in use by the admin interface CSS as well as some SVG logos and other templates.
I'd be fine with dropping it in all those places and removing our dependency on fonts.google.com for all Warehouse pages (except our 404 page, this should remain).
However I'll leave this for @nlhkabu to approve since ultimately it has the effect of changing the font all of PyPI will render with.

On my side, I'd prefer to maintain Source Sans Pro where we can.
Are we able to target this per language (at least for now), as per https://www.w3.org/International/questions/qa-css-lang ?
FYI, support in this font is coming (slowly....) - see:
https://github.com/adobe-fonts/source-sans/issues/87 and
https://github.com/google/fonts/issues/1744

oh, and I should have said - thanks for your work on this @betatim! :tada:

Are we able to target this per language (at least for now), as per w3.org/International/questions/qa-css-lang ?

Oh wow! I didn't know that this existed. I'll do some reading to find out what the answer is. If someone knows the answer to this question please post it (don't wait for me to find out first :D )

We could close this pull request and instead rely on the new version of Source Code Pro as @nlhkabu described on 23 Apr 2021.
The two third-party changes that @nlhkabu are now resolved:

adobe-fonts/source-sans#87 was resolved in 2019
google/fonts#1744 was merged on 15 Sep 2021

I confirmed today that https://pypi.org/help/#file-size-limit now displays italic ”меншого” using:

Chrome 100.0 on macOS 12.3
Firefox 98.0 on Ubuntu 20.04 LTS
Safari 15.4 on macOS 12.3

We could close this pull request and instead rely on the new version of Source Code Pro

That would work for me. I'll close this PR. Thanks for following up!

authors: betatim di divbzero nlhkabu webknjaz


text:
Subprocess Python 2/3 incompatibility

Bug
When running Python 3 as subprocess from Python 2 host it is possible to hit situation when there are modules in PYTHONPATH that breaks Python 3. We are now passing whole environment by default and that can include paths with
dangerous code. This is especially problematic with stuff in site-package, because there can be .pth files that contains
python code with imports and those are processed immediately when python is started.
To Reproduce
Steps to reproduce the behavior:

Create site-packages directory, install few modules inside and install python futures module (because that one directly throws exceptions when imported in python 3, so it is easier to see the problem).
Add it to some Python 2 host to PYTHONPATH
Run some python 3 subprocess from python 2 host - for example try to publish Review with Extract burnin plugin that is executing python 3 script
See error

Possible solution
Possible solution would be to pass only "default" OpenPype environment if custom one is not explicitly specified. For example - we know that OpenPype needs path/A and path/B in PYTHONPATH so it should pass to subprocess only those.
[cuID:PYPE-1322]

I think in most of cases when we need to run Python 3 form Python 2 host is when we want run OpenPype, so we can not pass PYTHONPATH in those cases at all. It happens only during publishing, or?

It can happen anytime as by default we are passing whole environment. But in this current case it happened during publishing in Extract burnin while running that OTIO script. We should state it in subprocess docstring that this can be used only to run OpenPype parts (at your risk in another words :)). And probably pop out PYTHONPATH from environment nevertheless.

And probably pop out PYTHONPATH from environment nevertheless.

Well yes, but only place where OpenPype (python) subprocess is used like that is with otio script and Deadline plugin (where it is already solved).
So "fix" should be to change function run_subprocess in ~/openpype/lib/execute.py.
Change line env = kwargs.get("env") or os.environ into:
env = kwargs.get("env")
if env is None:
    env = os.environ

...and documentation information (somewhere?) that it is not recommended as dependencies from source process may break new OpenPype process on start.

Closing as this was edge case until it happens again :)

authors: antirotor iLLiCiTiT

repo: pypeclub/OpenPype


text:
Settings: Move imageio from project anatomy to project settings [pypeclub]

Brief description
Expansion of https://github.com/pypeclub/OpenPype/pull/3909
Additional info

Nuke: added enable switch on project_settings/nuke/imageio so it is possible detect backward compatible projects.

Testing notes:

[x] Flame
[x] (and Flare?)
[x] Maya
[x] Nuke
[x] Hiero
[x] (Did Resolve have any? I couldn't find it. If it didn't, let's check this box and continue our ignorance.)

Conflict resolve is needed


text:
Add badges/info about abi3 packages forward compatibility

What's the problem this feature will solve?

When looking at the list of wheels in a given release of a Python package distribution, there may be a lot of files and the compat column only takes a Python version part into consideration ignoring the ABI.
Describe the solution you'd like

Annotate the dists with something (probably a badge, like for pre- and yanked releases) that would clearly indicate support for Python 3.x+, not just 3.x, in those wheels.
In doing so, PyPI will improve the users' understanding of what to expect from pip install.
Additional context

I realized that this info is missing from the website after seeing the confusion in these issues:

https://github.com/pypa/gh-action-pypi-publish/issues/56
https://github.com/pyca/cryptography/issues/5787
https://github.com/pyca/cryptography/issues/5798

Since this issue was created, the release files page has changed a bit. The cp36 column is now a flag on the release file:

I think it'd be good to turn this into one or more tags that are more explicit and human-friendly about what Python versions the artifact is compatible with.

xref #10646

xref #15606

authors: di webknjaz

repo: pypi/warehouse


text:
add demo script to readme

Adding demo code snippet

Hello @MateoLostanlen, thanks for adding more documentation, seems pretty clear to me !

authors: MateoLostanlen chloeskt

repo: pyronear/pyro-engine


text:
Define blockchain APIs

Objective
We need to set the basic input and output of this small library such that consumers have the freedom to implement the storage and data however they'd like
Alleviate the need blockchain implementation to know anything about storage and data usage .
this library will only focus on the consensus and networking.

This is ideally what I would like:

fn add_transaction(& transaction: Transaction, callBack: Fn) -> Result<Block,Err> {
 // lowest level
}
fn add_blockchain_listener(bc: &Blockchain, callBack: Fn) -> Result<Block,Err> {
 // highest level
}

fn add_block_listener(block: Block, callBack: Fn) -> Result<Block,Err> {
   // middle level
}

add_transaction(&t, |block_chain| saveToFile(block_chain))
add_transaction(&t)
blockchain.add_finalizer_listener(|finalBlock| saveToFile(finalBlock))

Originally posted by @chb0github in https://github.com/pyrsia/pyrsia/issues/315#issuecomment-1029280624

Criteria:
define the trait
implement it in the example "simple_node" to demonstrate it's usage

repo: pyrsia/pyrsia


text:
2.5.0 release

Any new package highlights can be added to CHANGELOG.md.

either way works re. my name.
Thx!

From: James Gaboardi @.>
Sent: Monday, July 26, 2021 4:38:12 AM
To: pysal/pysal @.>
Cc: Julia Koschinsky @.>; Mention @.>
Subject: Re: [pysal/pysal] 2.5.0 release (#1226)
@jGaboardi commented on this pull request.

In CHANGELOG.mdhttps://github.com/pysal/pysal/pull/1226#discussion_r676253444:

+* #1223: Spatial Weights issue, Points geometry not allowed
+* #1220: Could not load shared object file: llvmlite.dll
+* #1218: 2.4.0

+
+## Contributors
+
+Many thanks to all of the following individuals who contributed to this release:
+
+

Arfon Smith

Dani Arribas-Bel

Eli Knaap

Elliott Sales De Andrade

James Gaboardi

Jkoschinsky

Should we have Julia's GitHub handle or her name? @jkoschinskyhttps://github.com/jkoschinsky

same for:
*   Mragank @MgeeeeKhttps://github.com/MgeeeeK
*   Xin (Selena) vs. Xin @xf37https://github.com/xf37

And we should add @ljwolfhttps://github.com/ljwolf.

In requirements_docs.txthttps://github.com/pysal/pysal/pull/1226#discussion_r676254745:

@@ -1,7 +1,7 @@
sphinx>=1.4.3
sphinxcontrib-napoleon
sphinx-gallery
-sphinxcontrib-bibtex
+sphinxcontrib-bibtex<2.0.0

I would say we can remove this pin (and the >=1.4.3 from sphinx), but that would require adding thishttps://github.com/pysal/spaghetti/blob/888047b1efb93a09e30653589cee383ef54d2958/docs/conf.py#L37 to docs/conf.py (which seems like doesn't exist?).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/pysal/pysal/pull/1226#pullrequestreview-714399570, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADILY76VHLWEUI5KWIQ4IOLTZTDBJANCNFSM5A64A46Q.

I'd like to get esda released as well to make it in here. I'm waiting on a merge at esda/#133, and I'll then cut the release myself.

authors: jkoschinsky ljwolf sjsrey

repo: pysal/pysal


text:
nonplanar example update

Hello!
I just want to highlight an issue for the libpysal notebook example used to demonstrate nonplanar_neighbors for plot_spatial_weights. I think it's better to use the example 'map_RS_BR.shp', instead of '43MUE250GC_SIR.shp', because the current example has 2 great lakes in the shapefile which is not the case for assuming contiguity between cities. Is there a way to update this?

Thank you for the spotting @renanxcortes I updated the example in #30.

authors: renanxcortes slumnitz

repo: pysal/splot


text:
Fix Simulator #sims calculation for NFsim

Network free simulators use initials_dict instead of initials,
as they don't always have a full list of species available.
The Simulator class calculates the number of simulations by
checking the number of initials and parameter sets defined.
With one parameter set and multiple initials defined, only
one NFsim simulation was run (with the first set of initials).
This PR fixes this issue and adds multiple unit tests for NFsim.

Coverage increased (+0.1%) to 78.31% when pulling 42c71865aaea4223a95e39792da9a2d7a24ec5f3 on alubbock:nfsim_fixes into 4c51327b7a7b70c776c840f22dda4be92f1ec96c on pysb:master.

Coverage increased (+0.1%) to 78.31% when pulling 42c71865aaea4223a95e39792da9a2d7a24ec5f3 on alubbock:nfsim_fixes into 4c51327b7a7b70c776c840f22dda4be92f1ec96c on pysb:master.

authors: alubbock coveralls

repo: pysb/pysb


text:
PySCF wheels for Python 3.10

The current PySCF wheels on PyPI are for Python 3.6 - 3.9. It will be very helpful to have Python 3.10 wheels on PyPI as well. Is there any plan to upload them?

python 3.10 is adding to test pipeline (PR #1249). It will be added to release pipeline next step. Wheels for python 3.10 shall be available in 2.1 release

Available in pyscf 2.1

authors: soranjh sunqm

repo: pyscf/pyscf


text:
Update on Fermi Smearing for Molecules?

Referring to the previous discussion on Fermi Smearing for molecules [#1560: [https://github.com/pyscf/pyscf/issues/1560] I am curious if there have been any updates or resolutions (it is my understanding that it works only for PBC).
Thank you,
Stefan

It supports the molecular SCF models too. You can find the smearing function in addons.py https://github.com/pyscf/pyscf/blob/ceea353b1ac07b0f10de480220ed9b27ee1eeb41/pyscf/scf/addons.py#L38

Hi @stefanvuckovic1 , thanks for asking. Has your question been answered?

authors: stefanvuckovic1 sunqm verena-neufeld


text:
More unit tests

This PR adds a bunch of unit tests based on analysis of the coverage maps from coveralls.io.  There are also some small fixes in the code for uncovered bugs and fix other problems:

Added a reset_defaults function in config.py to allow configuration parameters to be reset to their initial values (used in unit testing).

Changed the exceptions in exceptions.py to derive from appropriate exception types instead of the base Exception class.  Not really used, but seemed like a better way to allow people to catch exceptions using existing Python exception types.

Small fixes in documentation as I found some inconsistencies.

A few things that aren't addressed:

Unit tests for some of the plotting functions (including grid.py) are still low.  These are tricky to capture in good unit tests, so I left them alone.

There are lots of exceptions that are used for catching bad inputs.  I started writing unit tests to cover those, but since they aren't functional code, I decided it wasn't critical.

These changes brought the coverage up to about 80% in my version.  Will try to set that as a target going forward.

Coverage increased (+2.7%) to 80.906% when pulling de5219352e3a412bddbf5269f2be95829edef3f0 on murrayrm:more_unit_tests into 7188a9cfc1677a905112736ba59b34eb94c22696 on python-control:master.

authors: coveralls murrayrm

repo: python-control/python-control


text:
Stats update

CHANGES

Added the ".aoc stats" command to allow users to view their own or other's stats - including if and at what time parts were completed

Changed the original ".aoc stats" command to ".aoc daily" to avoid confusion

Added ".aoc register" to allow users to link their usernames to their Discord accounts (for the use of ".aoc stats"

Thus added a JSON file containing the ids of users along with their names (that can be read or written to)

Other than @MarkKoz's comments, there are quite a few flake8 issues that need resolving.
If this is going to return all 25 days worth of stats it might be better off if this was DMed to the invoking user otherwise the response is going to dominate the chat every time it's called (also an easy spam target without a cooldown).
Another casual musing would be to allow for an optional day specifier to limit the results.

Closing for inactivity. Feel free to ping us if this gets picked up again!

repo: python-discord/seasonalbot


text:
align left and right on the same line

What steps will reproduce the problem?
1. use Epson TM-T20
2. execute the following code
3.

What is the expected output? What do you see instead?
I would like to format a line to begin on the left with some words ("article"
in my example) and then align on the right to write the price (15.00 € here)

What version of the product are you using? On what operating system?
python-escpos 1.0-1 on ubuntu 13.10

Please provide any additional information below.

code :
Epson.set("LEFT", "A", "", 1, 1)
Epson.text("Article 1")
Epson.set("RIGHT", "A", "", 1, 1)
Epson.text("15.00 \xd5")
Epson.text("\n")

Original issue reported on code.google.com by shu...@gmail.com on 15 May 2014 at 10:29

I don't think that escpos printers are capable of this. Probably the best way to do that is by using tabs.

I have the same needs as in this issue but I don't know at all how tabs work. Any link to some documentation or something about setting tabs for a printer?

The way I am doing this myself is, using knowledge of the column count, inserting the required amount of whitespace.
I am using https://github.com/miracle2k/py-xml-escpos.

@MicroJoe For Epson there is the website at https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=2
If you create a login it also has some nice structuring. Maybe this can help?

I have the WinBond/Zjiang 5890 on my desk. Given the problems I encounter with this printer it may handle the horizontal tabs wrong.
I think the best option is to use the printer knowledge database in order to retrieve the column number as explained by @miracle2k and then fill with spaces. I think it should be integrated in the libràry (maybe we can call this "software horizontal tabs support").

@MicroJoe this sounds sensible to me.
Probably best would be getting #161 merged (this is probably my task) and then building on top of this the "software" tabs. (Would you like to do this?)

Yeah I think #161 should be merged before. Then we can add a softtab=False default attribute that would store the tab positions in an array and then when text is called we can match the \t characters and use spaces to layout text.
We could even add more capabilites to the software tabs like align left or right on tabs, but this will then make software tabs incompatible with hardware tabs (not sure about this because at the moment I don't understand at all how hardware horizontal tabs work, someone should explain me this before I implement something).

I am also not 100% how hardware tabs work. But as far as I get it, you can set multiples of columns as tab positions before printing. (Iirc you can have 16) Then, during printing, you can jump to the next horizontal tab with the proper command.

Ok, I have played with hardware tabs on my printer with the following snippet:
for i in range(0,32):
    p.control('HT', i)
    p.text('test\tff\n')

p.print_and_feed(2)

Of course I had to patch the 1 to 16 limit in the control method:
        elif ctl.upper() == "HT":
            #if not (1 <= pos <= 16):
            #    raise TabPosError()
            #else:
                # Set tab positions
            self._raw(CTL_SET_HT + six.int2byte(pos))

And I got this result:

So it seems to me that the control('HT', x) method sets the tab size and not the tab position. I am not sure if this is because of my printer or if this behavior is observed on reference Epson hardware. If this behavior is the same on Epson printers we can create a set_tab_size method or similar, and remove the 1-16 limit.

Unfortunately I never got around to implementing  it, but if we were to separate the API into a low-level ESC/POS wrapper and a higher-level layout API (https://github.com/python-escpos/python-escpos/issues/176), we could implement soft-tabs in the latter, while the raw tabs API is separate. In other words, it needn't worry about compatibility between soft and hardtabs if for the user the choice is abstracted away in the layout system.
Having said that, I wonder in what way hard tabs might be superior to soft tabs. Is there anything lost by using softtabs exclusively? Larger data sizes, maybe?

I had to use this feature for receipt-like printing recently. Here is the snippet that I used (with hardcoded width from my printer):
def leftright(p, left, right, font='b'):
    if font == 'a':
        p.textln("{:<20}{:>12}".format(left, right))
    else:
        p.textln("{:<30}{:>12}".format(left, right))

Maybe we can think of a kind of API for this. At least it will help if someone wants to do this right now without using a cleaner solution (I think this is Python 3 only).

Is there any solution available for question in any of the latest updates?

As you can see in this issue, the behavior of hardware tabs has been fixed in #238. You could therefore try issuing tabstops. Apart from that no other relevant changes have been implemented.

I create this solution isn't perfect, cause utilize the max column length from profile, but works
def line_align_texts(p: printer.Serial, texts:List[str]):
    num_col = p.profile.get_columns(0)

    space = round((num_col - sum(len(i) for i in texts)) / (len(texts) - 1))
    text_build = ''.join(i + (" " * space) for i in texts[:-1])
    text_build += texts[-1]

    p.set(align='left', font='a')
    p.textln(text_build)

authors: GoogleCodeExporter MicroJoe VitorHugoOli miracle2k patkan praneshvrp1396

repo: python-escpos/python-escpos


text:
Youtube Video Downloader

Script Title - Script should be able to download YT videos
what will change - Adding script
Instructions

Create a new folder for your script and file/folder name should be appropriate.
Create a README.md in your folder for program Instructions
add requirements.txt if needed

Please add/delete options that are not relevant.

[x] Adding New Code

Programming Language

[x] Python

Happy Coding,

Hi, I'm up to developing this script ! :point_up:
Is it possible to use third party libraries like pytube?

okay, that's fine but make the process smooth as possible and add args for triggering script :)

authors: LucasVanHaaren pawangeek

repo: python-geeks/Automation-scripts


text:
Align floating elements

Hi,
I used the following script that the user @dothinking in the following issue of pdf2docx:
https://github.com/dothinking/pdf2docx/issues/54
to create a floating image, then I tried to do a center align to the image but it didn't work, so I want to know if it's possible to align a floating Office Word element, I suppose it's like a drawing.

Floating image means you can put it where you want to, so you're not able to align it center like a normal flowing element. Instead, you can calculate the position (x,y coordinates of top-left corner) where it's center aligned, then set it directly when creating the floating image.

repo: python-openxml/python-docx


text:
support for Text Form Fields and Checkboxes

I saw that Text Form Fields and Checkboxes are not implemented. docx-form has those implemented and I was able to extend it so that one can find and edit TextFormFields and Checkboxes with bookmarks. But sadly that project is not being maintained anymore,
Will they be implemented here at some point?
I would love to help and code it myself but it seems quite complex and I'm having a hard time understanding all classes and functions here

I might be interested in folding support for form elements into python-docx. Just ran into that need today. I've not had a chance to study https://github.com/Southeastern-Louisiana-University/docx-form to weigh how hard integrating the two code bases would be.


text:
Zsh completion for sub-commands adds an extra slash and fails to complete sub-command options

With the beta version 1.2.0b1 of Poetry I can see that sub-commands and their options show up in the generated zsh completion script.
However, there is some weird behavior when trying to tab-complete on zsh command line.
First of all, it completes the sub-command with an additional slash: poetry env\ info – which is not a valid command..
poetry env + tab adds the slash and shows the expected subcommands:
❯ poetry env\
env info    -- Displays information about the current environment.
env list    -- Lists all virtualenvs associated with the current project.
env remove  -- Remove virtual environments associated with the project.
env use     -- Activates or creates a new virtualenv for the current project.

Also, with this my zsh is unable to autocomplete the option(s) for the subcommand. I was trying poetry env info --p + tab, hoping to get --path completed but zsh just offers the global options of poetry:
❯ poetry env info --p
--help            -- Display help for the given command. When no command is given display help for the list command.
--no-interaction  -- Do not ask any interactive question.
--quiet           -- Do not output any message.
--version         -- Display this application version.

References:

For more background, there's this original discussion on Poetry side: https://github.com/python-poetry/poetry/issues/1855#issuecomment-1140250076
Maybe related (?): https://github.com/python-poetry/cleo/issues/133 (although it's about bash completion, not zsh).
Seems like there's an issue about entirely missing the sub-commands with zsh https://github.com/python-poetry/cleo/issues/84 – likely that issue is basically resolved because now the sub-commands are showing up?

First of all, it completes the sub-command with an additional slash: poetry env\ info – which is not a valid command..

As far as I can tell, poetry env\ info is syntactically valid, as well as poetry 'env info' and poetry "env info" when invoking the sub-command (or any for that matter), with tab completions working for all three.
The issue of the options not getting added to the sub-command has to do with the case patterns in the com clauses in the completions script. To correct this in my project that uses cleo, I temporarily monkey patched the first element of desc in the render_zsh method for the completions command:
            desc = [
                f"            (([\\\"\\']|){command.replace(' ', '*')}([\\\"\\']|))",
                "            opts+=({})".format(" ".join(options)),
                "            ;;",
            ]

The above syntax is inelegant, but the generated glob patterns that get added to the completions script account for the 3 different ways of invoking sub-commands (that I know of), and the same goes for commands. The following invocation patterns would show associated options:
foo
'foo'
"foo"
bar\ baz
'bar baz'
"bar baz"

What I'm using:
$ which $SHELL
/bin/zsh
$ zsh --version
zsh 5.8.1 (x86_64-apple-darwin21.0)
$ python --version
Python 3.10.2
$ poetry show cleo
 name         : cleo
 version      : 1.0.0a5
 description  : Cleo allows you to create beautiful and testable command-line interfaces.

dependencies
 - crashtest >=0.3.1,<0.4.0
 - pylev >=1.3.0,<2.0.0

Reopening, since not all issues mentioned here were resolved.

@Secrus If you take a look at what I mentioned above, you'll see that I only made a change in one place to get the sub-commands to operate correctly. The sub-commands don't need to be quoted in the coms array. This essentially breaks sub-command invocation when using tab completion:
$ cleo-completions \'spaced\ command\'
'spaced command'  -- Sub-command example for the purposes of testing completions script.
help              -- Displays help for a command.
list              -- Lists commands.
$ cleo-completions \'spaced\ command\'

The command "'spaced command'" does not exist.

Did you mean this?
    spaced command

The issue in the zsh script before the most recent change appeared to be with the sub-command patterns in the com case statement. To get around this in my own project the glob pattern I used is ([\"\']|) which bookends the commands. This will match either a single quote, double quote or zero occurrences of the pattern. The * that replaces the single whitespace character for subcommands will match on whitespace or \ .
The following are examples of how I invoked the command:
$ cleo-completions spaced\ command --
--ansi            -- Force ANSI output.
--bar             -- Bar.
--foo             -- Foo.
--help            -- Display help for the given command. When no command is given display help for the list command.
--no-ansi         -- Disable ANSI output.
--no-interaction  -- Do not ask any interactive question.
--quiet           -- Do not output any message.
--verbose         -- Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
--version         -- Display this application version.
$ cleo-completions spaced\ command
spaced command was invoked.

or
$ cleo-completions 'spaced command' --
--ansi            -- Force ANSI output.
--bar             -- Bar.
--foo             -- Foo.
--help            -- Display help for the given command. When no command is given display help for the list command.
--no-ansi         -- Disable ANSI output.
--no-interaction  -- Do not ask any interactive question.
--quiet           -- Do not output any message.
--verbose         -- Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
--version         -- Display this application version.
$ cleo-completions 'spaced command'
spaced command was invoked.

or
$ cleo-completions "spaced command"
--ansi            -- Force ANSI output.
--bar             -- Bar.
--foo             -- Foo.
--help            -- Display help for the given command. When no command is given display help for the list command.
--no-ansi         -- Disable ANSI output.
--no-interaction  -- Do not ask any interactive question.
--quiet           -- Do not output any message.
--verbose         -- Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
--version         -- Display this application version.
$ cleo-completions "spaced command"
spaced command was invoked.

Hope this helps.

@mickyhale thanks. The patch I made recently was mostly addressing issues with completions script reporting errors when invoked. I have a refactor on the way that will introduce new syntax to the completions script, especially for commands with subcommands. I have it on hold since right now we want to focus on delivering a new stable version since it breaks some Poetry use cases (python-poetry/poetry#6353).

authors: Secrus juhoautio mickyhale

repo: python-poetry/cleo


text:
Union of Kafka streams should not freeze when either of the sources freezes/fails.

PR tries to resolve #308.
In the event when CK encounters an exception at get_watermark_offsets, we typically need to recreate (resubscribe to the topic) the consumer in case we want to consume the next time around when Kafka is up again. I'm thinking there might be a cleaner way than this, though.
Below is the example notebook I ran to confirm if this works. I have also attached the output of each cell.
from streamz import Stream
import random
import confluent_kafka as ck

PRODUCER_ARGS = {
    "bootstrap.servers": "localhost:9092"
}
producer = ck.Producer(PRODUCER_ARGS)
j1 = random.randint(0, 10000)
CONSUMER_ARGS1 = {
    "bootstrap.servers": "localhost:9092",
    "group.id": 'streamz-test%i' % j1,
    "enable.auto.commit": "false",
    "enable.partition.eof": "true",
    "session.timeout.ms": "60000",
    "auto.offset.reset": "earliest"
}
TOPIC1 = "prod"
TOPIC2 = "backup"

a = Stream.from_kafka_batched(TOPIC1, CONSUMER_ARGS1)
a.start()

b = Stream.from_kafka_batched(TOPIC2, CONSUMER_ARGS1)
b.start()

a.union(b).sink(print)

producer.produce(TOPIC1, '{"name":"Prod", "amount":50}', "")
producer.produce(TOPIC2, '{"name":"Backup", "amount":100}', "")

[b'{"name":"Backup", "amount":100}']
[b'{"name":"Prod", "amount":50}']
After Deleting prod topic
producer.produce(TOPIC2, '{"name":"Backup", "amount":150}', "")
producer.produce(TOPIC2, '{"name":"Backup", "amount":200}', "")

[b'{"name":"Backup", "amount":150}', b'{"name":"Backup", "amount":200}']
After Recreating prod topic
producer.produce(TOPIC1, '{"name":"Prod", "amount":50}', "")
producer.produce(TOPIC1, '{"name":"Prod", "amount":250}', "")
producer.produce(TOPIC1, '{"name":"Prod", "amount":300}', "")
producer.produce(TOPIC2, '{"name":"Backup", "amount":350}', "")

[b'{"name":"Prod", "amount":250}', b'{"name":"Prod", "amount":300}']
[b'{"name":"Backup", "amount":350}']
Should we add a test for this?

From my test, the Confluent lib did a pretty good job of reconnecting when the cluster came back.  I wonder if everything will work if we add a yield gen.sleep(1) where there's a pass to yield control back to the event loop.

The yield sounds right, perhaps with exponential backoff

I think I see what the issue here is.  I set up a test with two local Kafka clusters.  However, I can demonstrate this with just one.  It seems that get_watermark_offsets does not respect the timeout when Kafka is not available. So, the test is:

Start Kafka
Start the script below
Kill Kafka with ctrl+c
Notice the output

from time import sleep

import confluent_kafka as ck

def main():
    params = {'bootstrap.servers': 'localhost:9092',
              'group.id': 'test-group',
              'enable.auto.offset.store': False}

    c = ck.Consumer(params)

    while True:
        tp = ck.TopicPartition('test-topic', 0)
        print(c.get_watermark_offsets(tp, timeout=1))
        print('tick')
        sleep(1)

if __name__ == '__main__':
    main()

I see there's an issue for this already in the confluent repo: https://github.com/confluentinc/confluent-kafka-python/issues/413
Also this: https://github.com/confluentinc/confluent-kafka-python/issues/412

authors: chinmaychandak jsmaupin martindurant

repo: python-streamz/streamz


text:
await websocket.recv()  block the coroutine loop.

This problem is not consistently reproducible.
I have a client program that, when started, receives information from the server, processes it, and then sends the result back to the server. However, I have encountered an issue: after the client processes a batch of data, it enters a frozen state where all coroutines stop running. It remains in this state until I press Ctrl+C to exit. By this time, the server has already disconnected due to not receiving a 'pong' in time. The client then restarts the connection and the cycle repeats.
Here is my sample code.
class WebSocketClient:
    def __init__(self, uri):
        self.uri = uri
        self.websocket = None
        self.lock = asyncio.Lock()

    async def connect(self):
        while True:
            try:
                self.websocket = await websockets.connect(self.uri)
                break
            except OSError as e:
                logging.error()

    async def send_message(self, message):
        if message:
            async with self.lock:
                await self.websocket.send(message)

    async def listen(self):
        try:
            while True:
                message = await self.websocket.recv()
                logging.info(f"Message from {self.uri}: {message}")
                # await anthor coroutine
                # send message
                await send_message("xxx")
        except Exception as e:
            logging.error(f"listen error :{e} , stopping listen task.")
            raise

    async def run(self, interval):
        while True:
            listen_task = None
            try:
                await self.connect()
                listen_task = asyncio.create_task(self.listen())
                await listen_task
            finally:
                if self.websocket and not self.websocket.closed:
                    await self.websocket.close()

async def main():
    client = WebSocketClient(server_str, plugin)
    await client.run()

if __name__ == "__main__":
    asyncio.run(main(), debug=True)

The log is probably something like this.
2024-05-20 21:11:00 | websockets.client | DEBUG | < PING '' [0 bytes]
2024-05-20 21:11:00 | websockets.client | DEBUG | > PONG '' [0 bytes]
2024-05-20 21:11:30 | websockets.client | DEBUG | < PING '' [0 bytes]
2024-05-20 21:11:30 | websockets.client | DEBUG | > PONG '' [0 bytes]
2024-05-20 21:12:00 | websockets.client | DEBUG | < PING '' [0 bytes]

At this point, it entered a frozen state. When I press Ctrl+C, the following log is output.
2024-05-20 21:15:00 | websockets.client | DEBUG | > PONG '' [0 bytes]
2024-05-20 21:15:00 | websockets.client | DEBUG | < PING '' [0 bytes]
2024-05-20 21:15:00 | websockets.client | DEBUG | > PONG '' [0 bytes]
2024-05-20 21:15:00 | websockets.client | DEBUG | < PING '' [0 bytes]
2024-05-20 21:15:00 | websockets.client | DEBUG | > PONG '' [0 bytes]

It seems that when the log mentioned above is being output, only the coroutine for await websocket.recv() is running. It appears that this is causing a blockage in the entire coroutine loop. Even when I replaced it with await asyncio.wait_for(websocket.recv(), 60), it still causes a blockage.
Please help me solve this problem. Thanks

This doesn't look like a bug in websockets. With the info you provided, I have no hypothesis of what may cause the issue you're seeing.
There's at least two clear problems in the code but I don't have enough information to tell if and how they could lead to blocking:

every time you create a new connection, you run a new coroutine runningself.listen and it isn't guaranteed that self.listen terminates when that connection closes (because the definition of self.websocket can change while self.listen is running)

the lock is completely unnecessary

authors: aaugustin liyi-lee

repo: python-websockets/websockets


text:
🛑 Private Message Api is down

In 1808ef1, Private Message Api (https://privatemessages.roblox.com/) was down:

HTTP code: 404
Response time: 87 ms

Resolved: Private Message Api is back up in 408e0fb after 20 minutes.

repo: pythoniaweb/roblox-status


text:
🛑 Account Settings is down

In 3f642cb, Account Settings (https://accountsettings.roblox.com/) was down:

HTTP code: 404
Response time: 126 ms

Resolved: Account Settings is back up in 47a74d6 after 23 minutes.


text:
Adding Image with description and 2 content Image slide types

Needed some additional slide types, so we just opened up two more of the existing slides in the project templates. Also moved app.xml to an ERB since I noticed that it had hardcoded title descriptions.

Thanks for your contribution. I will review your changes in the next day or so and get back to you.

Your contribution has been merged into master and a new gem version(1.8) has been published which includes your changes. Thanks again for your valuable contribution.
:+1:

authors: BoopBoopBeepBoop pythonicrubyist

repo: pythonicrubyist/powerpoint


text:
token/s speed

Based on the mixtral-moe branch, I was able to convert mixtral, as well as quantised it to int8. The speed of tks/s is similar to the benchmark, being 70 tokens/s on 2xA100.. However on longer prompts (my test cases comprise prompts of over 3000 tokens), the speed of tokens/s dramatically decreases to 6 tks/s.. why is that and is it possible to reduce the gap ?

@S-Yacer I didn't test with very long prompts, I suspect this is caused by prefill. I'll look at this issue further.

when removing prefill, im running into OOM rapidly.. or cuda related errors.

@S-Yacer I was not saying to remove prefill, I think we need more optimized implementation of prefill (when bs > 1). I have that code locally, but I need to fix my dev node firstly and update the mixtral-moe branch.

thank you ! I look forward to the update to test again ^ ^

authors: S-Yacer yanboliang

repo: pytorch-labs/gpt-fast


text:
[Tracker] WIP features for torchao 0.3

Focus - benchmarking, documentation, tutorials, prototype to beta
Due date: June 13 2024
Spillover from 0.2.0

[x] Consolidating workflows to use tensor subclass @jerryzh168
[x] Fast sparse training @jcaip
[ ] Explore adding HQQ 4/3/2-bit quant to torchao @HDCharles @mobicham
[ ] Don't cause a "import error" when someone is using a feature unsupported by e.g. torch 2.1.2 (e.g. https://github.com/pytorch-labs/ao/blob/046dc985de6d5eac05c6575cc71505687e3aadf1/torchao/quantization/quant_primitives.py#L42 will cause an import error if someone tries to use torchao.quantization.quant_primitives.per_token_dynamic_quant on 2.2.2

Benchmarking

[ ] Setup model level benchmark for accuracy and performance in torchbench for single quantization API, so that we can start deprecating quant primitives and quant apis after making sure no regressions (@HDCharles)
[ ] Benchmarks for auto quant on pytorch benchmark's inference quant pane (@HDCharles)

Documentation

[ ] https://github.com/pytorch/ao/issues/181
[ ] Make our website sparkle https://pytorch.org/ao (everyone)
[ ] Unify on README or website, but don't duplicate content
[ ] Get started on a design to slot in the prototype features - HQQ (@msaroufim)

Tutorials

[ ] Tutorial for affine quantization dtype and unified quant primitives - Found lots of subtle differences, especially w.r.t. preserving zeros and tinygemm (@jerryzh168)

Core

[x] QAT workflow (@andrewor14)
[x] dedup the implementations of quant primitives (@jerryzh168)
[x] dedup the implementations of quant APIs (@jerryzh168)
[ ] Deduplicate int4 workflows
[x] Factory function ahd implements decorator for affine quantization dtype
[x] Bit packing interfaces @msaroufim
[x] float6 kernels @gau-nernst
[ ] int 3/5 kernel @msaroufim

@msaroufim

Generally, what needs to be done to compose a new dtype with FSDP?
What other dtypes are on the ao roadmap for integration with FSDP?
Is there a universal representation for asymmetric / symmetrically quantized types in torch?  I.e., a subbyte/byte type with scale / zero that can be used regardless of the quantization method?

Happy to contribute on any of these fronts.

@jeromeku for

Is there a universal representation for asymmetric / symmetrically quantized types in torch? I.e., a subbyte/byte type with scale / zero that can be used regardless of the quantization method?

yes, it's called AffineQuantizedTensor, we are putting all types of symmetric/asymmetric, per_tensor/channel/group/token, int8/int4/int3/... under this tensor subclass.
here is an model level API walk through using the tensor subclass: https://github.com/pytorch/ao/tree/main/torchao/quantization#quantization-flow
currently I'm working on replacing existing APIs with it: https://github.com/pytorch/ao/pull/294, after that I also plan to publish a more detailed tutorials to talk about how to implement a new data representation with tensor subclass, using this as an example

@jeromeku regarding your other questions

To compose new dtypes with FSDP you can follow the playbook here https://github.com/pytorch/ao/pull/150 we'll look to write some docs @weifengpy but let us know if you have any questions in the meantime
I guess regarding high pri dtypes, I'm not 100% sure yet cause it depends on what researchers might do - I'm personally biased to getting bitnet to work
Regarding fp8 training we're looking to centralize the fp8 work in this repo and @vkuzo is gonna be moving bits over time

Are we going to support dynamic inputs?

Hi @bhack! Seen you on a lot of threads. Could you share a bit more what you mean by dynamic inputs? Are you referring to dynamic shapes?

Yes dynamic input shape but not mainly on the batch dimension. So e.g. image with different width and height

authors: bhack jeromeku jerryzh168 msaroufim supriyar

repo: pytorch/ao


text:
Torchaudio and Sox disagree on audio duration of mp3 when using sox_io backend

🐛 Describe the bug
When loading certain audios in torchaudio, the number of samples (and hence duration) differs from what is output by sox (v14.4.2) and soxi, while using the sox_io backend to torchaudio. Torchaudio.load however does agree with ffmpeg, is torchaudio using ffmpeg or sox for backend decoding here? Any solutions for getting sox and torchaudio to agree on duration?
TorchAudio
>>> torchaudio.backend.get_audio_backend()
'sox_io'
>>> y, sr = torchaudio.load('smash.mp3')
>>> y.shape
torch.Size([1, 13824])

FFMpeg
>>> ffmpeg -i smash.mp3

Duration: 00:00:00.86, start: 0.000000, bitrate: 24 kb/s
    Stream #0:0: Audio: mp3, 16000 Hz, mono, fltp, 24 kb/s

Soxi
>>> soxi smash.mp3

Input File     : 'smash.mp3'
Channels       : 1
Sample Rate    : 16000
Precision      : 16-bit
Duration       : 00:00:00.83 = 13248 samples ~ 62.1 CDDA sectors
File Size      : 2.59k
Bit Rate       : 25.0k
Sample Encoding: MPEG audio (layer I, II or III)

Sox
>>> sox smash.mp3 -n stat

Samples read:             13248
Length (seconds):      0.828000
Scaled by:         2147483647.0
Maximum amplitude:     0.762141
Minimum amplitude:    -0.353673
Midline amplitude:     0.204234
Mean    norm:          0.047697
Mean    amplitude:    -0.000218
RMS     amplitude:     0.100115
Maximum delta:         0.259187
Minimum delta:         0.000000
Mean    delta:         0.017760
RMS     delta:         0.029922
Rough   frequency:          761
Volume adjustment:        1.312

Example Audio for Reproduction:
Google Drive Link to Audio
Possibly Related Issue
https://github.com/pytorch/audio/issues/329
Versions
ububtu 20.04
sox 14.4.2
torch 1.13.1
torchaudio 0.13.1

Hi @rbracco
This is a bit complicated.
What we konw is that libsox and FFmpeg treat MP3 differently. https://github.com/pytorch/audio/issues/1500 has some description about the padding. We think that FFmpeg's behavior is the correct one because it prevents the grows/shrink of signal data when saving/loading the data. In v0.12, torchaudio switched to ffmpeg for loading mp3, which is the reason why it does not match with the bare sox command.

Any solutions for getting sox and torchaudio to agree on duration?

At the moment, no. But we are making some changes to IO, which can resolve this. In the upcoming release, we are introducing a backend dispatcher so that one can specify IO backend per function call. https://github.com/pytorch/audio/issues/2950 In the release after that, we plan to change the way libsox is linked. libsox will be linked dynamically and we will ask users to install libsox. This way, the same mp3 decoder/encoder that sox command uses will be used by torchaudio.load with libsox backend.

Thanks for the thorough explanation, I can work around it but just wanted to make sure it was on your radar. Glad to know a long-term solution is on the way.

authors: mthrok rbracco

repo: pytorch/audio


text:
Processing CNN/DM dataset

I'm trying to reproduce the results from the Lightweight convolution paper  on the abstractive summarization. I'm looking for a script or the steps to process the CNN/DM dataset with Fairseq. I tried to google it but I wasn't able to find any information on how to preprocess the data. The raw data contain multi-sentence summaries so I'm not sure how I'm supposed to handle them and let the decoder generate all of them.
Any help is appreciated.

Hi @lioutasb, I have same problem. Do you solve this?

repo: pytorch/fairseq


text:
AOTAutograd-related test cases failing

test/test_memory_efficient_fusion.py

NoChangeTestCase.test_rand_like
NoChangeTestCase.test_rand_n

test/test_minifier.py TestMinifier.test_has_mul_minifier
See https://app.circleci.com/pipelines/github/pytorch/functorch/3291/workflows/77fc0ebb-257e-4c5c-94e6-64a32a5c1667/jobs/25312 for details
I'm going to xfail them for now, cc @Chillee @anijain2305

Should be fixed by https://github.com/pytorch/functorch/commit/442483cf1efc0ccaa9b98ec4f51397c4f749c1a7

Thanks, CI looks green now

repo: pytorch/functorch


text:
[torch-ort-infer] Aten fallback doesn't work

Aten op doesn't fallback to native pytorch runtime as expected.
Versions:
Torch - 1.12.0
OnnxRuntime - 1.12.0
Torch-ort-infer - 1.12.0
Reproduction steps:
import torch
from torch_ort import ORTInferenceModule

def test_numpy_T(input_shape):
    class NeuralNet(torch.nn.Module):
        def __init__(self):
            super(NeuralNet, self).__init__()
        def forward(self, input):
            return input.T

    device = "cpu"
    ort_model = ORTInferenceModule(NeuralNet().to(device))

    def run_step(model, input):
        prediction = model(input)
        return prediction

    ort_input = torch.rand(input_shape, dtype=torch.float, device=device)
    ort_prediction = run_step(ort_model, ort_input)

if __name__ == "__main__":
    test_numpy_T([3, 2, 5])

Error log
Traceback (most recent call last):
File "unit_test_atenop.py", line 23, in
test_numpy_T([3, 2, 5])
File "unit_test_atenop.py", line 20, in test_numpy_T
ort_prediction = run_step(ort_model, ort_input)
File "unit_test_atenop.py", line 16, in run_step
prediction = model(input)
File "/ort_aten_fb/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/ort_aten_fb/lib/python3.8/site-packages/torch_ort/ortinferencemodule/_utils_infer.py", line 98, in _forward
return ortinferencemodule._forward_call(*inputs, **kwargs)
File "/ort_aten_fb/lib/python3.8/site-packages/torch_ort/ortinferencemodule/ortinferencemodule.py", line 107, in _forward_call
self._inference_session = onnxruntime.InferenceSession(
File "/ort_aten_fb/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 347, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/ort_aten_fb/lib/python3.8/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 386, in create_inference_session
sess = C.InferenceSession(session_options, self.model_bytes, False, self.read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Node (ATen_0) output arg (data) type inference failed.
Tested with symbolic shape inference call from ORTModule(ref: symbolic_shape). Fails with Exception("Incomplete symbolic shape inference").

Can you please try with the latest PyTorch nightly?

With PyTorch nightly, Aten Fallback is no longer valid since numpy_T converts to Transpose(https://github.com/pytorch/pytorch/pull/79269).

Thanks @saipj. Do you have another model we can test with?

@saipj I had a play with this with the triu op that we talked about this morning. There were a couple of work arounds that I had to make, specifically add a custom symbolic as ORT could not infer the shape and type info for this op, as well as loading the aten cpp executor (this can be moved into ORTInferenceModule). Have a look at: https://github.com/natke/aten_snippet/blob/main/aten_model.py

@natke : Can you add this example in this repo? Explaining how to set the type when type inference fails in ORT.

@askhade Yes, sure

authors: askhade natke saipj

repo: pytorch/ort


text:
[SPMD] Tighten _is_param data ptr check

I am reading the compiler code, and I noticed something minor with the _is_param check. Checking .storage().data_ptr() means that views are considered equal. For example:
>>> t = torch.randn((3, 3))
>>> t.data_ptr()
94158967421632
>>> t.storage().data_ptr()
94158967421632
>>> s = t[1:]
>>> s.data_ptr()
94158967421644  <-- offset by 12 bytes (3 elements) representing skipping the 0th row
>>> s.storage().data_ptr()
94158967421632  <-- same as that of `t`

If I understand correctly, any input to the forward will be represented by an fx.Node whose name starts with primals_. In that case, if the forward takes in a view of a parameter, then the saved primal mappings may include an extra entry, "double-counting" the parameter, which should trigger the assert in _map_primal_to_param():
https://github.com/pytorch/tau/blob/11a8896707848524b3c0ee20354b319f9f475bc0/spmd/compiler/distribute.py#L498-L501
Ideally, this PR would add a unit test that fails before this change and passes after. However, I am still familiarizing with the code base, so this PR is mainly meant to point this out to the core developers.

Test failures look real. Let me investigate.

Nevermind. The tests are failing on the latest commit in main as well.

I don't think the test failures are related:
NotImplementedError: Operator aten.fill.Scalar does not have a DistributedTensor rule registered.

Sounds good. I will merge then.

Wait how do you guys usually merge? "Squash and merge"?

Yes, exactly.

If my memory is correct, only the unique parameters will have primal_ name prefix. Views will have another naming.

authors: awgu fegin lessw2020

repo: pytorch/tau


text:
How to calculate the total batchsize

Hi, it is me again~ I have a quick simple question: I am using the following training config with 4 GPUs. What is the total number of tokens per optimizer step? Is it 2 * 2048 or 2 * 2048 * 4?
[training]
batch_size = 2
seq_len = 2048
warmup_steps = 2000  # lr scheduler warm up, normally 20% of the train steps
max_norm = 1.0  # grad norm clipping
steps = 10000
data_parallel_degree = -1
tensor_parallel_degree = 1
fp8_linear = ""
compile = false

You need to multiply the batch_size with the data_parallel_degree. So 2 * 2048 * 4 is what you are looking for.

authors: fegin zyushun

repo: pytorch/torchtitan


text:
Add PyCon AU 2017 talks

Fixes #329

Good work !

authors: Daniel-at-github redapple

repo: pyvideo/data


text:
Pyright/Pylance : Some types are potentially unknown

This happens with all _ns_module.* types as far as I can tell, but here's an example from windows.graphics.directx.direct3d11.__init__.py:

Then in windows.graphics.capture.__init__.pyi

Which produces strict type-checking errors in my code, unless I explicitly specify the type:

Even though IDirect3DSurface is defined in windows.graphics.directx.direct3d11.__init__.pyi:

I don't think this is expected behavior from python-winsdk (it doesn't seem like it). Nor do I know why it's happening or how to fix it. I can raise an issue over at Pyright if you can't correct this issue and believe it's on their side.

It sounds like Pylance has changed since last time I used it (which was probably a few months ago). It is probably worth asking there how to handle "weird" imports like this. For example, are there some kind of comments or type hints we can add to tell it to only look at the .pyi files for certain modules?
There are also some typing fixes I haven't released yet - although I don't think they will help in this case.

I think I found the issue. winsdk.windows.graphics.capture imports winsdk.windows.ui.composition but this module isn't available for technical reasons. This is what introduces the Unknown to all of the typings in the file.
I think we can fix it by changing the imports to something like:
import winsdk.windows.foundation as _winsdk_windows_foundation

Probably could still be considered a bug in Pylance though.

I can confirm that changing the import to import winsdk.windows.ui.composition as _winsdk_windows_ui_composition in the pyi file only and     def create_from_visual(visual: _winsdk_windows_ui_composition.Visual) -> GraphicsCaptureItem: ...
Does fix it

Even from winsdk.windows.ui import composition then composition.Visual seems to work (not sure if there's other side effects.
I guess as long as you don't use winsdk.windows.ui.composition.<something> directly in the type definition.

Let's see if we can get it fixed in Pyright first.

https://github.com/microsoft/pyright/issues/3328#issuecomment-1097547290
https://github.com/microsoft/pyright/releases/tag/1.1.237

Bug Fix: Fixed bug that resulted in incorrect type evaluation when an import statement failed to resolve and targeted a submodule of a previous import statement, such as import a.b followed by import a.b.c where a.b.c couldn't be resolved. In this circumstance, pyright "forgot" that a.b had been resolved previously, so all symbols imported from a.b were evaluated as Unknown.

authors: Avasam dlech

repo: pywinrt/python-winsdk


text:
Doesn't seem to work with stateless components

I'd like to use this but I can't get it to work with the stateless components added in React 0.14

Hi @davidblurton thanks for pointing this out.
I've fixed compatibility with React 0.14 see Stateless function components and also updated the demo to include some examples of this.
Unfortunately is not as magical as I would like but should work nevertheless.
Cheers!

Very nice! Thanks for the speedy fix.

authors: davidblurton pzavolinsky


text:
🛑 nitter.fediflix.org is down

In ecf9c01, nitter.fediflix.org (https://nitter.fediflix.org) was down:

HTTP code: 403
Response time: 862 ms

Resolved: nitter.fediflix.org is back up in 075f7c9 after 12 minutes.


text:
🛑 nitter.fediflix.org is down

In 3fc3f1e, nitter.fediflix.org (https://nitter.fediflix.org) was down:

HTTP code: 403
Response time: 732 ms

Resolved: nitter.fediflix.org is back up in 2bdae2a after 5 minutes.


text:
🛑 nitter.domain.glass is down

In 1efb4f8, nitter.domain.glass (https://nitter.domain.glass) was down:

HTTP code: 503
Response time: 445 ms

Resolved: nitter.domain.glass is back up in a5ab4ef after 1 hour, 8 minutes.


text:
🛑 nitter.poast.org is down

In 0e00074, nitter.poast.org (https://nitter.poast.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nitter.poast.org is back up in 8235240 after 5 minutes.


text:
🛑 nitter.us.projectsegfau.lt is down

In fa96947, nitter.us.projectsegfau.lt (https://nitter.us.projectsegfau.lt) was down:

HTTP code: 503
Response time: 122 ms

Resolved: nitter.us.projectsegfau.lt is back up in 5f3dd04 after 40 minutes.


text:
🛑 nitter.net is down

In d07fcb8, nitter.net (https://nitter.net) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nitter.net is back up in 303a45a.


text:
🛑 nitter.poast.org is down

In b4f5784, nitter.poast.org (https://nitter.poast.org) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nitter.poast.org is back up in 64d2181 after 5 minutes.


text:
🛑 nitter.privacytools.io is down

In a8244e6, nitter.privacytools.io (https://nitter.privacytools.io) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nitter.privacytools.io is back up in 0964949.


text:
🛑 nitter.tiekoetter.com is down

In c260320, nitter.tiekoetter.com (https://nitter.tiekoetter.com) was down:

HTTP code: 502
Response time: 737 ms

Resolved: nitter.tiekoetter.com is back up in 305d5dd after 5 minutes.


text:
🛑 nitter.tiekoetter.com is down

In e9d9ab7, nitter.tiekoetter.com (https://nitter.tiekoetter.com) was down:

HTTP code: 502
Response time: 649 ms

Resolved: nitter.tiekoetter.com is back up in 3bd31f0 after 13 minutes.


text:
🛑 notabird.site is down

In 885d353, notabird.site (https://notabird.site) was down:

HTTP code: 520
Response time: 67 ms

Resolved: notabird.site is back up in ec9355f after 5 minutes.


text:
🛑 nitter.us.projectsegfau.lt is down

In 22ebefd, nitter.us.projectsegfau.lt (https://nitter.us.projectsegfau.lt) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nitter.us.projectsegfau.lt is back up in 247988c after 52 minutes.


text:
🛑 notabird.site is down

In 281daa3, notabird.site (https://notabird.site) was down:

HTTP code: 520
Response time: 75 ms

Resolved: notabird.site is back up in a4b89a7 after 50 minutes.


text:
Switching to grpc crashes search code

When I run the code on the REST API on port 6333, the below code works fine.
(matches, _) = client.scroll(
        collection_name="database_mock_df_flat",
        scroll_filter={
            # type: ignore
            "must": [{"key": "CDS_ids", "match": {"any": protein_ids}}]
        },
        with_vectors=True,
        with_payload=True,
        limit=len(protein_ids),
    )

When I initialize the qdrant client with prefer_grpc=True, I get this error (expand for full traceback).

ValueError: Protocol message Condition has no "key" field.
tatta-playground-backend-1   | ERROR:    Exception in ASGI application
tatta-playground-backend-1   | Traceback (most recent call last):
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 317, in __call__
tatta-playground-backend-1   |     stat_result = await anyio.to_thread.run_sync(os.stat, self.path)
tatta-playground-backend-1   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/anyio/to_thread.py", line 56, in run_sync
tatta-playground-backend-1   |     return await get_async_backend().run_sync_in_worker_thread(
tatta-playground-backend-1   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 2134, in run_sync_in_worker_thread
tatta-playground-backend-1   |     return await future
tatta-playground-backend-1   |            ^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 851, in run
tatta-playground-backend-1   |     result = context.run(func, *args)
tatta-playground-backend-1   |              ^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   | FileNotFoundError: [Errno 2] No such file or directory: 'static/assets/favicon.ico'
tatta-playground-backend-1   |
tatta-playground-backend-1   | During handling of the above exception, another exception occurred:
tatta-playground-backend-1   |
tatta-playground-backend-1   | Traceback (most recent call last):
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
tatta-playground-backend-1   |     result = await app(  # type: ignore[func-returns-value]
tatta-playground-backend-1   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
tatta-playground-backend-1   |     return await self.app(scope, receive, send)
tatta-playground-backend-1   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
tatta-playground-backend-1   |     await super().__call__(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 116, in __call__
tatta-playground-backend-1   |     await self.middleware_stack(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
tatta-playground-backend-1   |     raise exc
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
tatta-playground-backend-1   |     await self.app(scope, receive, _send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
tatta-playground-backend-1   |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app
tatta-playground-backend-1   |     raise exc
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app
tatta-playground-backend-1   |     await app(scope, receive, sender)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 746, in __call__
tatta-playground-backend-1   |     await route.handle(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
tatta-playground-backend-1   |     await self.app(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
tatta-playground-backend-1   |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app
tatta-playground-backend-1   |     raise exc
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app
tatta-playground-backend-1   |     await app(scope, receive, sender)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
tatta-playground-backend-1   |     await response(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/responses.py", line 320, in __call__
tatta-playground-backend-1   |     raise RuntimeError(f"File at path {self.path} does not exist.")
tatta-playground-backend-1   | RuntimeError: File at path static/assets/favicon.ico does not exist.
tatta-playground-backend-1   | Calling qdrant at http://host.docker.internal:6333
tatta-playground-backend-1   | INFO:     192.168.65.1:53231 - "POST /api/protein_search HTTP/1.1" 500 Internal Server Error
tatta-playground-backend-1   | ERROR:    Exception in ASGI application
tatta-playground-backend-1   | Traceback (most recent call last):
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
tatta-playground-backend-1   |     result = await app(  # type: ignore[func-returns-value]
tatta-playground-backend-1   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
tatta-playground-backend-1   |     return await self.app(scope, receive, send)
tatta-playground-backend-1   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
tatta-playground-backend-1   |     await super().__call__(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 116, in __call__
tatta-playground-backend-1   |     await self.middleware_stack(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 186, in __call__
tatta-playground-backend-1   |     raise exc
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 164, in __call__
tatta-playground-backend-1   |     await self.app(scope, receive, _send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
tatta-playground-backend-1   |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app
tatta-playground-backend-1   |     raise exc
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app
tatta-playground-backend-1   |     await app(scope, receive, sender)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 746, in __call__
tatta-playground-backend-1   |     await route.handle(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
tatta-playground-backend-1   |     await self.app(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 75, in app
tatta-playground-backend-1   |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 55, in wrapped_app
tatta-playground-backend-1   |     raise exc
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 44, in wrapped_app
tatta-playground-backend-1   |     await app(scope, receive, sender)
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 70, in app
tatta-playground-backend-1   |     response = await func(request)
tatta-playground-backend-1   |                ^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 299, in app
tatta-playground-backend-1   |     raise e
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 294, in app
tatta-playground-backend-1   |     raw_response = await run_endpoint_function(
tatta-playground-backend-1   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
tatta-playground-backend-1   |     return await dependant.call(**values)
tatta-playground-backend-1   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/app/main.py", line 38, in protein_search
tatta-playground-backend-1   |     result = query_qdrant_with_protein_embedding(query_embedding, limit, ENV)
tatta-playground-backend-1   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/app/qdrant_utils.py", line 70, in query_qdrant_with_protein_embedding
tatta-playground-backend-1   |     proteins = fetch_protein_batch(
tatta-playground-backend-1   |                ^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/app/qdrant_utils.py", line 154, in fetch_protein_batch
tatta-playground-backend-1   |     (matches, _) = client.scroll(
tatta-playground-backend-1   |                    ^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/qdrant_client/qdrant_client.py", line 1094, in scroll
tatta-playground-backend-1   |     return self._client.scroll(
tatta-playground-backend-1   |            ^^^^^^^^^^^^^^^^^^^^
tatta-playground-backend-1   |   File "/usr/local/lib/python3.11/site-packages/qdrant_client/qdrant_remote.py", line 1407, in scroll
tatta-playground-backend-1   |     grpc.ScrollPoints(
tatta-playground-backend-1   | ValueError: Protocol message Condition has no "key" field.

The documentation implies I would not need to change my code to use REST vs. grpc. Is that wrong?

hi, thanks for pointing it out!
we'll take a look asap
yes, you don't need to change your code

Oh, wow! Good catch. I think I was playing around with the API so naturally copied over the json. Perhaps we could raise an error if a plain dict is passed in? Everything was working normally so seems like it'd be helpful to have that flagged. (Or at least log a warning.)

authors: jlkravitz joein

repo: qdrant/qdrant-client


text:
can i chanche the user volume

i want to chanche the user volume with commands for the bot im making and to find out if there is a way to play youtube videos in discordie

I need to do the same but I can't find a way :c I'd like to change the sound volume

There is a way to do this. Just look at the documentation under encoders and ffmpeg encoder.

authors: Julisep kessanro lluiscab

repo: qeled/discordie


text:
Can I render/reset an environment based on a specific observation?

I am conducting an experiment where I test different starting points for the completion of the task and I want to visualize these starting points afterwards. Is there any way to visualize these points by using the observation?

Hi, sorry for the delay. The easiest way would be to render directly when the starting point are generated:
import gymnasium as gym
from PIL import Image

import panda_gym

env = gym.make("PandaPickAndPlace-v3", render_mode="rgb_array", renderer="OpenGL")

# Render the starting point
env.reset()
Image.fromarray(env.render()).save("starting_point.png")

# Interract
for _ in range(50):
    env.step(env.action_space.sample())

env.close()

If, for some reasons, you really want to do it afterward, you can use the save/restore state feature:
import gymnasium as gym
from PIL import Image

import panda_gym

env = gym.make("PandaPickAndPlace-v3", render_mode="rgb_array", renderer="OpenGL")

# Reset and save the initial state
env.reset()
state_id = env.save_state()

# Interract
for _ in range(50):
    env.step(env.action_space.sample())

# Restore initial state and render it
env.restore_state(state_id)
Image.fromarray(env.render()).save("starting_point.png")

env.close()

authors: cchristofi qgallouedec

repo: qgallouedec/panda-gym


text:
Uncertainty detached from graph?

Hi,
Here:
https://github.com/qianqianwang68/caps/blob/8fcf29270d12c67d2f2bf326049e575420b171fe/CAPS/criterion.py#L19-L23
The uncertainty weight is detached from the computational graph.
Could you provide some intuition as to why this is done?

Hi, good question. We detached the weight because otherwise it may cause degenerate issues.  If we allow gradient from the weight, then instead of trying to minimize the epipolar distance, the network might just choose to reduce its weight in the loss, and that is not what we want. Hope this makes some sense.

Hi, thanks for the reply.
Having the gradients attached did degenerate the learning as you mention. Although I thought this would in theory be counteracted by the normalization which is done. Anyway, I'll close this issue.