Skip to content

Commit d22e783

Browse files
authored
Merge pull request #3 from mdmintz/refactoring
Refactoring
2 parents 9f84968 + a07df56 commit d22e783

9 files changed

Lines changed: 109 additions & 30 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
1+
# This workflow will install Python dependencies, run tests, and lint with a variety of Python versions.
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Python package
4+
name: CI build
55

66
on:
7-
push:
8-
branches: [ master ]
97
pull_request:
10-
branches: [ master ]
8+
branches:
9+
push:
10+
branches:
11+
- master
12+
workflow_dispatch:
13+
branches:
1114

1215
jobs:
1316
build:
@@ -19,7 +22,7 @@ jobs:
1922
fail-fast: false
2023
max-parallel: 6
2124
matrix:
22-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
25+
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
2326

2427
steps:
2528
- uses: actions/checkout@v2

.gitignore

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ geckodriver
7272
msedgedriver
7373
operadriver
7474
MicrosoftWebDriver.exe
75+
headless_ie_selenium.exe
7576
IEDriverServer.exe
7677
chromedriver.exe
7778
geckodriver.exe
@@ -124,15 +125,21 @@ images_exported
124125
# Cookies
125126
saved_cookies
126127

128+
# Recordings
129+
recordings
130+
127131
# Automated Visual Testing
128132
visual_baseline
129133

130-
# MkDocs
134+
# MkDocs WebSite Generator
131135
site/*
132-
docs/*.md
133-
docs/*/*.md
134-
docs/*/*/*.md
135-
docs/*/*/*/*.md
136+
mkdocs_build/*.md
137+
mkdocs_build/*/*.md
138+
mkdocs_build/*/*/*.md
139+
mkdocs_build/*/*/*/*.md
140+
141+
# macOS system files
142+
.DS_Store
136143

137144
# Other
138145
selenium-server-standalone.jar

CODE_OF_CONDUCT.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Code of conduct
2+
3+
(sbVirtualDisplay uses a modified version of [Flutter's Code of conduct](https://github.com/flutter/flutter/blob/master/CODE_OF_CONDUCT.md))
4+
5+
The sbVirtualDisplay project expects sbVirtualDisplay's contributors to act professionally and respectfully. sbVirtualDisplay contributors are expected to maintain the safety and dignity of sbVirtualDisplay's social environments.
6+
7+
Specifically:
8+
9+
* Respect people, their identities, their culture, and their work.
10+
* Be kind. Be courteous. Be welcoming.
11+
* Listen. Consider and acknowledge people's points before responding.
12+
13+
Should you experience anything that makes you feel unwelcome in sbVirtualDisplay's community, please [contact us](https://gitter.im/seleniumbase/SeleniumBase).
14+
15+
The sbVirtualDisplay project will not tolerate harassment in sbVirtualDisplay's community, even outside of sbVirtualDisplay's public communication channels.
16+
17+
## Questions
18+
19+
It's always OK to ask questions.
20+
21+
!["I try not to make fun of people for admitting they don't know things, because for each thing 'everyone knows' by the time they're adults, every day there are, on average, 10,000 people in the US hearing about it for the first time. If I make fun of people, I train them not to tell me when they have those moments. And I miss out on the fun." "Diet coke and mentos thing? What's that?" "Oh, man! We're going to the grocery store." "Why?" "You're one of today's lucky 10,000."](https://imgs.xkcd.com/comics/ten_thousand.png)
22+
23+
Source: _[xkcd, May 2012](https://xkcd.com/1053/)_

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributing
2+
3+
## Bug Reports
4+
5+
When opening a new issue or commenting on an existing issue, please make sure to provide concise, detailed instructions on how to reproduce the issue. If the issue can't be reproduced, it will be closed. Clearly describe the results you're seeing, and the results you're expecting.
6+
7+
## (A Note on Style Guide Rules)
8+
9+
[flake8](https://github.com/PyCQA/flake8) is the law of the land. The only flake8 rule ignored is [W503](https://github.com/grantmcconnaughey/Flake8Rules/blob/master/_rules/W503.md). For more details on why W503 should be ignored, see [this explanation](https://peps.python.org/pep-0008/#should-a-line-break-before-or-after-a-binary-operator), or [this shorter explanation](https://github.com/PyCQA/flake8/issues/494) by Python expert [Anthony Sottile](https://github.com/asottile).
10+
11+
--------
12+
13+
For questions about this document, reach out to [Michael Mintz](https://github.com/mdmintz).

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2014-2021 Michael Mintz
3+
Copyright (c) 2014-2022 Michael Mintz
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

SECURITY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you've found a security vulnerability in sbVirtualDisplay, (or a dependency we use), please open an issue.
6+
7+
[github.com/mdmintz/sbVirtualDisplay/issues](https://github.com/mdmintz/sbVirtualDisplay/issues)
8+
9+
Please describe the results you're seeing, and the results you're expecting.

sbvirtualdisplay/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# sbvirtualdisplay package
2-
__version__ = "1.0.0"
2+
__version__ = "1.1.0"

setup.cfg

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[flake8]
2+
# W503 (line break before binary operator) can be ignored.
3+
exclude=recordings,temp
4+
ignore=W503
5+
6+
[nosetests]
7+
# nocapture=1 (Display print statements from output)
8+
# (Undo this by using: "--nologcapture")
9+
# logging-level=INFO (Shorter logs than using DEBUG)
10+
nocapture=1
11+
logging-level=INFO
12+
13+
[bdist_wheel]
14+
universal=1

setup.py

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
long_description = "A customized pyvirtualdisplay for SeleniumBase."
2525
about = {}
2626
# Get the package version from the sbvirtualdisplay/__version__.py file
27-
with open(os.path.join(
28-
this_dir, "sbvirtualdisplay", "__version__.py"
29-
), "rb") as f:
27+
with open(
28+
os.path.join(this_dir, "sbvirtualdisplay", "__version__.py"), "rb"
29+
) as f:
3030
exec(f.read().decode("utf-8"), about)
3131

3232
if sys.argv[-1] == "publish":
@@ -38,21 +38,24 @@
3838
reply = str(input_method(confirm_text)).lower().strip()
3939
if reply == "yes":
4040
print("\n*** Checking code health with flake8:\n")
41-
os.system("python -m pip install 'flake8==3.9.2'")
41+
os.system("python -m pip install 'flake8==4.0.1'")
4242
flake8_status = os.system("flake8 --exclude=temp")
4343
if flake8_status != 0:
4444
print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
4545
sys.exit()
4646
else:
4747
print("*** No flake8 issues detected. Continuing...")
48-
print("\n*** Rebuilding distribution packages: ***\n")
48+
print("\n*** Removing existing distribution packages: ***\n")
4949
os.system("rm -f dist/*.egg; rm -f dist/*.tar.gz; rm -f dist/*.whl")
5050
os.system("rm -rf build/bdist.*; rm -rf build/lib")
51-
os.system("python setup.py sdist bdist_wheel") # Create new tar/wheel
51+
print("\n*** Installing build: *** (Required for PyPI uploads)\n")
52+
os.system("python -m pip install --upgrade 'build>=0.7.0'")
5253
print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
53-
os.system("python -m pip install --upgrade 'twine>=1.15.0'")
54+
os.system("python -m pip install --upgrade 'twine>=4.0.0'")
5455
print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")
55-
os.system("python -m pip install --upgrade 'tqdm>=4.61.2'")
56+
os.system("python -m pip install --upgrade 'tqdm>=4.64.0'")
57+
print("\n*** Rebuilding distribution packages: ***\n")
58+
os.system("python -m build") # Create new tar/wheel
5659
print("\n*** Publishing The Release to PyPI: ***\n")
5760
os.system("python -m twine upload dist/*") # Requires ~/.pypirc Keys
5861
print("\n*** The Release was PUBLISHED SUCCESSFULLY to PyPI! :) ***\n")
@@ -111,28 +114,35 @@
111114
"Topic :: Utilities",
112115
],
113116
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
114-
install_requires=[
115-
],
117+
install_requires=[],
116118
extras_require={
117119
# pip install -e .[coverage]
120+
# Usage: coverage run -m pytest; coverage html; coverage report
118121
"coverage": [
119-
"coverage==5.5",
120-
"pytest-cov==2.12.1",
122+
'coverage==5.5;python_version<"3.6"',
123+
'coverage==6.2;python_version>="3.6" and python_version<"3.7"',
124+
'coverage==6.3.2;python_version>="3.7"',
125+
'pytest-cov==2.12.1;python_version<"3.6"',
126+
'pytest-cov==3.0.0;python_version>="3.6"',
121127
],
122128
# pip install -e .[flake]
129+
# Usage: flake8
123130
"flake": [
124131
'flake8==3.7.9;python_version<"3.5"',
125-
'flake8==3.9.2;python_version>="3.5"',
132+
'flake8==3.9.2;python_version>="3.5" and python_version<"3.6"',
133+
'flake8==4.0.1;python_version>="3.6"',
134+
"mccabe==0.6.1",
126135
'pyflakes==2.1.1;python_version<"3.5"',
127-
'pyflakes==2.3.1;python_version>="3.5"',
136+
'pyflakes==2.3.1;python_version>="3.5" and python_version<"3.6"',
137+
'pyflakes==2.4.0;python_version>="3.6"',
128138
'pycodestyle==2.5.0;python_version<"3.5"',
129-
'pycodestyle==2.7.0;python_version>="3.5"',
139+
'pycodestyle==2.7.0;python_version>="3.5" and python_version<"3.6"', # noqa: E501
140+
'pycodestyle==2.8.0;python_version>="3.6"',
130141
],
131142
},
132143
packages=[
133144
"sbvirtualdisplay",
134145
],
135146
include_package_data=True,
136-
entry_points={
137-
},
147+
entry_points={},
138148
)

0 commit comments

Comments
 (0)