Skip to content

Commit 67803b8

Browse files
authored
Merge pull request #68 from dexplo/update_dependencies
Update dependencies
2 parents a1b7496 + 017f058 commit 67803b8

File tree

8 files changed

+2089
-1444
lines changed

8 files changed

+2089
-1444
lines changed

.github/workflows/constraints.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# constraints file to keep CI build packages the same
22
# this keeps builds deterministic i.e. same outcome for same input
33
# rather than code remaining unchanged but .whl file being different
4-
pip==21.3.1
5-
nox==2021.10.1
6-
nox-poetry==0.8.6
7-
poetry==1.1.11
8-
virtualenv==20.10.0
4+
pip==23.0.1
5+
nox==2022.11.21
6+
nox-poetry==1.0.2
7+
poetry==1.4.0

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# define our matrix as all op systems and 4 python versions
3030
matrix:
3131
os: [ubuntu-latest, macos-latest, windows-latest]
32-
python-version: [3.7, 3.8, 3.9]
32+
python-version: [3.8, 3.9]
3333
session: [tests]
3434

3535
# configure --session for nox to only run a specifc subset of test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ site/
99
*.pyc
1010
*.json
1111
Jupyter to Medium Initial Post_files/
12+
notebooks/
1213
Jupyter to Medium Initial Post_medium.md
1314
*_files/
1415
environment.yml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Before using this package, you must request an integration token from Medium by
4343

4444
### Creating the integration token
4545

46-
Once your request to create integration tokens is accepted, navigate to <a href="https://medium.com/me/settings">your Medium settings.</a> Towards the bottom of the page exists the section on Integration Tokens. Enter a description for the token (`jupyter_to_medium` is a good choice) and then create the token.
46+
Once your request to create integration tokens is accepted, navigate to <a href="https://medium.com/me/settings">your Medium settings.</a> In the 'Secuity & Apps' section at the bottom you'll see 'Integration tokens'. Enter a description for the token (`jupyter_to_medium` is a good choice) and then create the token.
4747

4848
![png](https://raw.githubusercontent.com/dexplo/jupyter_to_medium/master/docs/images/integration_token.png)
4949

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# --python=${{ matrix.python-version }}
2828
# which dictates which version of python is run on each runner
2929
package = "jupyter_to_medium"
30-
python_versions = ["3.9", "3.8", "3.7"]
30+
python_versions = ["3.9", "3.8"]
3131
nox.needs_version = ">= 2021.6.6"
3232
# options for nox sessions
3333
# again, github actions will pass one of these through the following lines

poetry.lock

Lines changed: 2068 additions & 1425 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "jupyter-to-medium"
3-
version = "0.2.10"
3+
version = "0.2.11"
44
description = "Publish a Jupyter Notebook as a Medium blogpost"
55
authors = ["dexplo <petrou.theodore@gmail.com>"]
66
maintainers = ["mjam03 <markjamison03@gmail.com>"]
@@ -10,7 +10,6 @@ homepage = "https://github.com/dexplo/jupyter_to_medium"
1010
repository = "https://github.com/dexplo/jupyter_to_medium"
1111
documentation = "https://www.dexplo.org/jupyter_to_medium/"
1212
classifiers = [
13-
"Programming Language :: Python :: 3.7",
1413
"Programming Language :: Python :: 3.8",
1514
"Programming Language :: Python :: 3.9",
1615
"License :: OSI Approved :: MIT License",
@@ -22,13 +21,13 @@ classifiers = [
2221
Changelog = "https://github.com/dexplo/jupyter_to_medium/releases"
2322

2423
[tool.poetry.dependencies]
25-
python = ">=3.7,<3.11"
26-
beautifulsoup4 = "^4.10.0"
27-
matplotlib = "^3.5.0"
28-
nbconvert = "5.6.1"
29-
numpy = "^1.21.4"
30-
requests = "^2.26.0"
31-
jupyter-contrib-nbextensions = "^0.5.1"
24+
python = ">=3.8,<3.11"
25+
beautifulsoup4 = "^4.12.0"
26+
matplotlib = "^3.7.1"
27+
nbconvert = "^7.2.10"
28+
numpy = "^1.24.2"
29+
requests = "^2.28.2"
30+
jupyter-contrib-nbextensions = "^0.7.0"
3231
jupyter = "^1.0.0"
3332

3433
[tool.poetry.dev-dependencies]

src/jupyter_to_medium/_screenshot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def __init__(
9393
self.css = self.get_css(fontsize)
9494
self.encode_base64 = encode_base64
9595
self.limit_crop = limit_crop
96+
self.enlarge_attempts = 0
9697

9798
def get_css(self, fontsize):
9899
mod_dir = Path(__file__).resolve().parent
@@ -146,8 +147,10 @@ def possibly_enlarge(self, img):
146147
self.ss_height = int(self.ss_height * 1.2)
147148
enlarge = True
148149

149-
if enlarge:
150-
return self.take_screenshot()
150+
if self.enlarge_attempts < 15:
151+
if enlarge:
152+
self.enlarge_attempts += 1
153+
return self.take_screenshot()
151154

152155
return self.crop(img, all_white_vert, all_white_horiz)
153156

0 commit comments

Comments
 (0)