notion-py icon indicating copy to clipboard operation
notion-py copied to clipboard

Add optional limit argument to get_block

Open c0j0s opened this issue 4 years ago • 20 comments
trafficstars

#292

although setting a new fixed limit works, adding an optional limit argument would be better if notion decide to change the query limit in the future.

c0j0s avatar Mar 05 '21 16:03 c0j0s

Well, overall the PR looks good. +1

dorileo avatar Mar 09 '21 03:03 dorileo

@jamalex plz take a look!

xiantang avatar Mar 10 '21 08:03 xiantang

this is a pretty paralyzing issue. does anyone know how long it will take for it to get merged in?

accounts01 avatar Mar 21 '21 09:03 accounts01

this is a pretty paralyzing issue. does anyone know how long it will take for it to get merged in?

In the meantime, you can pip install git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge or replace notion-py with git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge in your requirements.txt. I have tested and this fixed my issues 👍

gnestor avatar Mar 22 '21 18:03 gnestor

thanks a lot @gnestor! that's exactly what i needed :) and it's so much cleaner than fiddling with the code in site-packages which is what i ended up doing 🙈

accounts01 avatar Mar 23 '21 11:03 accounts01

Thanks a lot @gnestor! pip install git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge command installs specific versions of git repo on notion-py well.

However, I have problem using setuptools to specify the merge version of the git repo as dependency in my python package.

Referring to the this link, the install_requires specified as follows, but this does not work properly.

setuptools.setup(
    ...    
    install_requires=[
        "notion @ git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge"
    ],
    ...
)

Could you help me with this problem by any chance?

younho9 avatar Mar 27 '21 13:03 younho9

My setuptools chops are rusty, but try replacing notion @ git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge with git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge

gnestor avatar Mar 27 '21 17:03 gnestor

I tried the following setup.py settings, but the following error occurs.

setuptools.setup(
    ...    
    install_requires=[
        "git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge"
    ],
    ...
)
error in narkdown setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Parse error at "'+https:/'": Expected stringEnd

Also, I have tried the following with this answer.

But this method has a problem when uploading to pypi.

HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
Invalid value for requires_dist. Error: Can't have direct dependency: 'notion @ git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge'

I need to find a way to set git repo to direct dependence when uploading to pypi.

younho9 avatar Mar 28 '21 00:03 younho9

It looks like your original approach was the right way to do it in setuptools but I'm not sure how you can point to a git ref...

gnestor avatar Mar 28 '21 18:03 gnestor

I also couldn't find a way to upload a package that have a git repo as a dependency to pypi.

Instead, I solved the problem by importing the git forked version directly.

Thank you for your reply.

younho9 avatar Mar 29 '21 15:03 younho9

Hi @jamalex Can it be merged?

vzts avatar May 13 '21 04:05 vzts

Have you find the way to load/read more than 100 records at a time?

miletoda avatar Jun 30 '21 22:06 miletoda

Please audit and merge if possible. This is affecting many users!

This is stretching out to StackOverFlow

es-arif avatar Sep 02 '21 06:09 es-arif

Thanks a lot @gnestor! pip install git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge command installs specific versions of git repo on notion-py well.

However, I have problem using setuptools to specify the merge version of the git repo as dependency in my python package.

Referring to the this link, the install_requires specified as follows, but this does not work properly.

setuptools.setup(
    ...    
    install_requires=[
        "notion @ git+https://github.com/jamalex/notion-py.git@refs/pull/294/merge"
    ],
    ...
)

Could you help me with this problem by any chance?

Use the commit:

notion@git+https://github.com/jamalex/notion-py.git@fe8ac41e1c10a229c040bd7cadd9429a66fbcda3

paulaceccon avatar Jan 11 '22 22:01 paulaceccon

Is there a reason this hasn't been merged in yet? It's breaking lots of things :)

andrewspode avatar May 27 '22 15:05 andrewspode

FWIW I have started moving all my code across to the official Notion API. May not have feature parity but it will get there.

Sick of sourcing on a PR for a fix.

fanuch avatar May 31 '22 00:05 fanuch

I run the code to install commit with pip, but setup.py error occurred.

I run the following code, with hash code of this commit.

# fe8ac41e1c10a229c040bd7cadd9429a66fbcda3 is the hash code of this commit.
pip install git+https://github.com/jamalex/notion-py.git@fe8ac41e1c10a229c040bd7cadd9429a66fbcda3

I get an error related to setup.py.

Collecting git+https://github.com/jamalex/notion-py.git@fe8ac41e1c10a229c040bd7cadd9429a66fbcda3
  Cloning https://github.com/jamalex/notion-py.git (to revision fe8ac41e1c10a229c040bd7cadd9429a66fbcda3) to c:\users\uotik\appdata\local\temp\pip-req-build-g11n7s9k
  Running command git clone --filter=blob:none --quiet https://github.com/jamalex/notion-py.git 'C:\Users\uotik\AppData\Local\Temp\pip-req-build-g11n7s9k'
  Running command git rev-parse -q --verify 'sha^fe8ac41e1c10a229c040bd7cadd9429a66fbcda3'
  Running command git fetch -q https://github.com/jamalex/notion-py.git fe8ac41e1c10a229c040bd7cadd9429a66fbcda3
  Running command git checkout -q fe8ac41e1c10a229c040bd7cadd9429a66fbcda3
  Resolved https://github.com/jamalex/notion-py.git to commit fe8ac41e1c10a229c040bd7cadd9429a66fbcda3
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\uotik\AppData\Local\Temp\pip-req-build-g11n7s9k\setup.py", line 4, in <module>
          long_description = fh.read()
      UnicodeDecodeError: 'gbk' codec can't decode byte 0x92 in position 11951: illegal multibyte sequence
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

tyePhDCandy avatar Jan 29 '23 06:01 tyePhDCandy

@c0j0s or @jamalex Can you re-open this PR? Many of us are linking directly to the PR in our pip requirements.txt, and my deployments are now failing now that the PR is closed.

Context: https://stackoverflow.com/a/55959742/82156

emmby avatar Jul 01 '24 22:07 emmby

@c0j0s or @jamalex Can you re-open this PR? Many of us are linking directly to the PR in our pip requirements.txt, and my deployments are now failing now that the PR is closed.

Context: https://stackoverflow.com/a/55959742/82156

I closed this PR as it was included in #352 and was merged into the master branch.

I'll reopen it again, didn't realise closing this would have such side effect.

c0j0s avatar Jul 01 '24 23:07 c0j0s

Even better, I didn't realize the changes had been merged in elsewhere. I'll switch to head, ty!

emmby avatar Jul 01 '24 23:07 emmby