diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0efbf0..97c0626 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,19 +14,19 @@ jobs: tests: env: - TOXENV: py38 + TOXENV: py311 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools tox + python -m pip install --upgrade pip setuptools tox build - name: Tests run: | python -m tox @@ -39,14 +39,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools tox + python -m pip install --upgrade pip setuptools tox build - name: Lint run: | python -m tox @@ -59,14 +59,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools tox + python -m pip install --upgrade pip setuptools tox build - name: Install Aspell run: | sudo apt-get install aspell aspell-en diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2742284..8a2171d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,16 +12,16 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools + python -m pip install --upgrade pip setuptools build python -m pip install -r docs/src/requirements.txt - name: Deploy documents run: | diff --git a/CHANGES.md b/CHANGES.md index d02b898..61e4f3c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # ScopeHunter +## 2.18.2 + +- **FIX**: Fix color API access failures. + ## 2.18.1 - **FIX**: Scope backtrace fixes. diff --git a/docs/src/markdown/about/contributing.md b/docs/src/markdown/about/contributing.md index 1db31e4..348d524 100644 --- a/docs/src/markdown/about/contributing.md +++ b/docs/src/markdown/about/contributing.md @@ -9,10 +9,10 @@ ST3 | Fully supported and actively maintained. Contribution from the community is encouraged and can be done in a variety of ways: -- Bug reports. -- Reviewing code. -- Code patches via pull requests. -- Documentation improvements via pull requests. +- Bug reports. +- Reviewing code. +- Code patches via pull requests. +- Documentation improvements via pull requests. ## Become a Sponsor :octicons-heart-fill-16:{: .heart-throb} @@ -24,27 +24,27 @@ any tier you feel comfortable with. No amount is too little. We also accept one ## Bug Reports -1. Please **read the documentation** and **search the issue tracker** to try to find the answer to your question - **before** posting an issue. +1. Please **read the documentation** and **search the issue tracker** to try to find the answer to your question + **before** posting an issue. -2. When an issue is created, a [template](https://github.com/facelessuser/ScopeHunter/blob/master/.github/ISSUE_TEMPLATE.md) - will be shown, please fill out the appropriate sections. If the template is not followed, the issue will be marked - `Invalid` and closed. +2. When an issue is created, a [template](https://github.com/facelessuser/ScopeHunter/blob/master/.github/ISSUE_TEMPLATE.md) + will be shown, please fill out the appropriate sections. If the template is not followed, the issue will be marked + `Invalid` and closed. -3. When creating an issue on the repository, please provide as much info as possible: +3. When creating an issue on the repository, please provide as much info as possible: - - Provide environment information by running `Preferences->Package Settings->RegReplace->Support Info`. The - information will be copied to the clipboard; paste the info in issue. - - Errors in console. - - Detailed description of the problem. - - Examples for reproducing the error. You can post pictures, but if specific text or code is required to reproduce - the issue, please provide the text in a plain text format for easy copy/paste. - - Provide link to color scheme used (with link if a 3rd party color scheme) if applicable. + - Provide environment information by running `Preferences->Package Settings->RegReplace->Support Info`. The + information will be copied to the clipboard; paste the info in issue. + - Errors in console. + - Detailed description of the problem. + - Examples for reproducing the error. You can post pictures, but if specific text or code is required to + reproduce the issue, please provide the text in a plain text format for easy copy/paste. + - Provide link to color scheme used (with link if a 3rd party color scheme) if applicable. The more info provided the greater the chance someone will take the time to answer, implement, or fix the issue. -4. Be prepared to answer questions and provide additional information if required. Issues in which the creator refuses - to respond to follow up questions will be marked as stale and closed. +4. Be prepared to answer questions and provide additional information if required. Issues in which the creator refuses + to respond to follow up questions will be marked as stale and closed. ## Reviewing Code @@ -63,20 +63,21 @@ it is strongly suggested that requesters make an effort to verify before request ### Running Validation Tests -!!! tip "Tip" - If you are running Sublime on a macOS or Linux/Unix system, you run all tests by by running the shell script - (assuming you have installed your environment fulfills all requirements below): +/// tip | Tip +If you are running Sublime on a macOS or Linux/Unix system, you run all tests by by running the shell script +(assuming you have installed your environment fulfills all requirements below): - ``` - chmod +x run_tests.sh - ./run_tests.sh - ``` +``` +chmod +x run_tests.sh +./run_tests.sh +``` +/// There are a couple of dependencies that must be present before running the tests. -1. As ST3 is the only current, actively supported version, Python 3.3 must be used to validate the tests. +1. As ST3 is the only current, actively supported version, Python 3.3 must be used to validate the tests. -2. Unit tests are run with pytest (@pytest-dev/pytest). You can install `pytest` via: +2. Unit tests are run with pytest (@pytest-dev/pytest). You can install `pytest` via: ``` pip install pytest @@ -88,13 +89,13 @@ There are a couple of dependencies that must be present before running the tests py.test . ``` -3. Linting is performed on the entire project with the following modules: +3. Linting is performed on the entire project with the following modules: - - @gitlab:pycqa/flake8 - - @gitlab:pycqa/flake8-docstrings - - @ebeweber/flake8-mutable - - @gforcada/flake8-builtins - - @gitlab:pycqa/pep8-naming + - @gitlab:pycqa/flake8 + - @gitlab:pycqa/flake8-docstrings + - @ebeweber/flake8-mutable + - @gforcada/flake8-builtins + - @gitlab:pycqa/pep8-naming These can be installed via: diff --git a/docs/src/markdown/about/license.md b/docs/src/markdown/about/license.md index fb2ed1e..f13c312 100644 --- a/docs/src/markdown/about/license.md +++ b/docs/src/markdown/about/license.md @@ -2,10 +2,17 @@ Scope Hunter is released under the MIT license. -Copyright (c) 2012 - 2022 Isaac Muse +Copyright (c) 2012 - 2025 Isaac Muse -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/docs/src/markdown/index.md b/docs/src/markdown/index.md index 09a25a0..62c4e4e 100644 --- a/docs/src/markdown/index.md +++ b/docs/src/markdown/index.md @@ -12,12 +12,12 @@ development. ## Features All features are configurable via the settings file -- Tooltip output showing scope, context backtrace, scope extent, color values, links to current syntax and relevant - color schemes. -- Customizable to show only the information you care about. -- Auto copy scope to clipboard on execution. -- Quick copy any or all information to the clipboard. -- Toggle instant scoping to keep showing scope as you move around a file. -- Supports [SubNotify][subnotify] messages. +- Tooltip output showing scope, context backtrace, scope extent, color values, links to current syntax and relevant + color schemes. +- Customizable to show only the information you care about. +- Auto copy scope to clipboard on execution. +- Quick copy any or all information to the clipboard. +- Toggle instant scoping to keep showing scope as you move around a file. +- Supports [SubNotify][subnotify] messages. --8<-- "refs.txt" diff --git a/docs/src/markdown/installation.md b/docs/src/markdown/installation.md index 0a4cbe9..663a80a 100644 --- a/docs/src/markdown/installation.md +++ b/docs/src/markdown/installation.md @@ -2,42 +2,51 @@ ## Package Control -The recommended way to install ScopeHunter is via [Package Control][package-control]. Package Control will install the correct branch on your system and keep it up to date. +The recommended way to install ScopeHunter is via [Package Control][package-control]. Package Control will install the +correct branch on your system and keep it up to date. -1. Ensure Package Control is installed. Instructions are found [here][package-control-install]. +1. Ensure Package Control is installed. Instructions are found [here][package-control-install]. -2. In Sublime Text, press ++ctrl+shift+p++ (Win, Linux) or ++cmd+shift+p++ (macOS) to bring up the quick panel and start typing `Package Control: Install Package`. Select the command and it will show a list of installable plugins. +2. In Sublime Text, press ++ctrl+shift+p++ (Win, Linux) or ++cmd+shift+p++ (macOS) to bring up the quick panel and + start typing `Package Control: Install Package`. Select the command and it will show a list of installable plugins. -3. Start typing `ScopeHunter`; when you see it, select it. +3. Start typing `ScopeHunter`; when you see it, select it. -4. Restart to be sure everything is loaded proper. +4. Restart to be sure everything is loaded proper. -5. Enjoy! +5. Enjoy! ## Manual Installation -!!! warning "Warning" - This is not the recommended way to install ScopeHunter for the average user. Installing this way **will not** get automatically updated. +/// warning | Warning +This is not the recommended way to install ScopeHunter for the average user. Installing this way **will not** get +automatically updated. - If you are forking for a pull request, you should **just** clone ScopeHunter and run Package Control's `Satisfy Dependency` command to get all the dependencies. +If you are forking for a pull request, you should **just** clone ScopeHunter and run Package Control's +`Satisfy Dependency` command to get all the dependencies. +/// -For those who want to install ScopeHunter without package control, here are the steps. It understood that some people for what ever reason will prefer manually and may even have legitimate reasons to do so. When going this route, you will have to keep all the packages updated yourself. +For those who want to install ScopeHunter without package control, here are the steps. It understood that some people +for what ever reason will prefer manually and may even have legitimate reasons to do so. When going this route, you +will have to keep all the packages updated yourself. --- -1. Download the latest releases of the following dependencies and unpack or git clone in the `Packages` folder as shown below: +1. Download the latest releases of the following dependencies and unpack or git clone in the `Packages` folder as shown + below: - - @bitbucket:teddy_beer_maniac/sublime-text-dependency-markupsafe -> `markupsafe` - - @bitbucket:teddy_beer_maniac/sublime-text-dependency-jinja2 -> `python-jinja2` - - @packagecontrol/pygments -> `pygments` - - @facelessuser/sublime-markdown-popups -> `mdpopups` - - @facelessuser/sublime-markdown -> `python-markdown` + - @bitbucket:teddy_beer_maniac/sublime-text-dependency-markupsafe -> `markupsafe` + - @bitbucket:teddy_beer_maniac/sublime-text-dependency-jinja2 -> `python-jinja2` + - @packagecontrol/pygments -> `pygments` + - @facelessuser/sublime-markdown-popups -> `mdpopups` + - @facelessuser/sublime-markdown -> `python-markdown` -2. Download and unpack or git clone the latest ScopeHunter release and unpack as `ScopeHunter`: +2. Download and unpack or git clone the latest ScopeHunter release and unpack as `ScopeHunter`: - - @facelessuser/ScopeHunter -> ScopeHunter + - @facelessuser/ScopeHunter -> ScopeHunter -3. Create a folder under `Packages` called `00-dependencies` and under that folder create a file called `00-dependencies.py`: +3. Create a folder under `Packages` called `00-dependencies` and under that folder create a file called + `00-dependencies.py`: Copy the following code to `00-dependencies.py` (this code was taken from Package Control): @@ -197,19 +206,20 @@ For those who want to install ScopeHunter without package control, here are the add_dependency('mdpopups') ``` -4. Restart and enjoy. +4. Restart and enjoy. ## Git Cloning -1. Quit Sublime Text. +1. Quit Sublime Text. -2. Open a terminal and enter the following. For dependencies replace the URL with the appropriate URL, and the appropriate folder to check it out to: +2. Open a terminal and enter the following. For dependencies replace the URL with the appropriate URL, and the + appropriate folder to check it out to: ``` cd /path/to/Sublime Text 3/Packages git clone https://github.com/facelessuser/ScopeHunter.git RegReplace ``` -3. Restart Sublime Text. +3. Restart Sublime Text. --8<-- "refs.txt" diff --git a/lib/file_strip/json.py b/lib/file_strip/json.py index 15c875e..1c37778 100644 --- a/lib/file_strip/json.py +++ b/lib/file_strip/json.py @@ -1,3 +1,4 @@ +# noqa: A005 """ File Strip. diff --git a/mkdocs.yml b/mkdocs.yml index 99c8e16..216e4fc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -4,7 +4,7 @@ repo_url: https://github.com/facelessuser/ScopeHunter edit_uri: tree/master/docs/src/markdown site_description: Syntax Scope Viewer in Sublime Text. copyright: | - Copyright © 2012 - 2022 Isaac Muse + Copyright © 2012 - 2025 Isaac Muse docs_dir: docs/src/markdown theme: @@ -37,12 +37,10 @@ markdown_extensions: - markdown.extensions.toc: slugify: !!python/name:pymdownx.slugs.uslugify permalink: "" - - markdown.extensions.admonition: - markdown.extensions.smarty: smart_quotes: false - pymdownx.betterem: - markdown.extensions.attr_list: - - markdown.extensions.def_list: - markdown.extensions.tables: - markdown.extensions.abbr: - markdown.extensions.footnotes: @@ -65,8 +63,8 @@ markdown_extensions: - pymdownx.caret: - pymdownx.smartsymbols: - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.escapeall: hardbreak: true nbsp: true @@ -79,17 +77,62 @@ markdown_extensions: base_path: docs/src/markdown/_snippets - pymdownx.keys: separator: "\uff0b" - - pymdownx.details: - - pymdownx.tabbed: - alternate_style: true - pymdownx.saneheaders: + - pymdownx.blocks.admonition: + types: + - new + - settings + - note + - abstract + - info + - tip + - success + - question + - warning + - failure + - danger + - bug + - example + - quote + - pymdownx.blocks.details: + types: + - name: details-new + class: new + - name: details-settings + class: settings + - name: details-note + class: note + - name: details-abstract + class: abstract + - name: details-info + class: info + - name: details-tip + class: tip + - name: details-success + class: success + - name: details-question + class: question + - name: details-warning + class: warning + - name: details-failure + class: failure + - name: details-danger + class: danger + - name: details-bug + class: bug + - name: details-example + class: example + - name: details-quote + class: quote + - pymdownx.blocks.html: + - pymdownx.blocks.definition: + - pymdownx.blocks.tab: + alternate_style: True extra: social: - icon: fontawesome/brands/github link: https://github.com/facelessuser - - icon: fontawesome/brands/discord - link: https://discord.gg/TWs8Tgr plugins: - search diff --git a/readme.md b/readme.md index 4838527..be11093 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,4 @@ [![Donate via PayPal][donate-image]][donate-link] -[![Discord][discord-image]][discord-link] -[![Build][github-ci-image]][github-ci-link] [![Package Control Downloads][pc-image]][pc-link] ![License][license-image] # ScopeHunter @@ -31,25 +29,6 @@ https://facelessuser.github.io/ScopeHunter/ Scope Hunter is released under the MIT license. -Copyright (c) 2012 - 2021 Isaac Muse - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[github-ci-image]: https://github.com/facelessuser/ScopeHunter/workflows/build/badge.svg -[github-ci-link]: https://github.com/facelessuser/ScopeHunter/actions?workflow=build -[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333 -[discord-link]: https://discord.gg/TWs8Tgr [pc-image]: https://img.shields.io/packagecontrol/dt/ScopeHunter.svg?labelColor=333333&logo=sublime%20text [pc-link]: https://packagecontrol.io/packages/ScopeHunter [license-image]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333 diff --git a/scope_hunter.py b/scope_hunter.py index c3e2753..0a1dab0 100644 --- a/scope_hunter.py +++ b/scope_hunter.py @@ -224,7 +224,7 @@ def setup_image_border(self, sh_settings): self.view.style()['background'], filters=SRGB_SPACES ).convert("hsl") - border_color.lightness = border_color.lightness + (30 if border_color.luminance() < 0.5 else -30) + border_color['l'] = border_color['l'] + (30 if border_color.luminance() < 0.5 else -30) self.default_border = border_color.convert("srgb").to_string(**HEX) self.out_of_gamut = Color("transparent", filters=SRGB_SPACES).to_string(**HEX) diff --git a/support.py b/support.py index d98f7d7..ec1d837 100644 --- a/support.py +++ b/support.py @@ -5,7 +5,7 @@ import webbrowser import re -__version__ = "2.18.1" +__version__ = "2.18.2" __pc_name__ = 'ScopeHunter' diff --git a/tox.ini b/tox.ini index 82c6013..0899880 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] skipsdist=True envlist = - py35,py36,py37,lint + py39,py310,py311,py312,py313,py314,lint [testenv] deps=