pax_global_header 0000666 0000000 0000000 00000000064 14644010763 0014517 g ustar 00root root 0000000 0000000 52 comment=77e3044493acf5ff8923725d49c31b75b7e00594
autoimport-1.6.0/ 0000775 0000000 0000000 00000000000 14644010763 0013726 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/.cruft.json 0000664 0000000 0000000 00000001740 14644010763 0016024 0 ustar 00root root 0000000 0000000 {
"template": "git@github.com:lyz-code/cookiecutter-python-project.git",
"commit": "68a4cf28a19c6518974b71ecd61b8313c291bd2f",
"context": {
"cookiecutter": {
"project_name": "Autoimport",
"project_slug": "autoimport",
"project_description": "Autoimport missing python libraries.",
"requirements": "autoflake",
"configure_command_line": "True",
"read_configuration_from_yaml": "True",
"github_user": "lyz-code",
"github_token_pass_path": "internet/github.lyz-code.api_token",
"pypi_token_pass_path": "internet/pypi.token",
"test_pypi_token_pass_path": "internet/test.pypi.token",
"author": "Lyz",
"author_email": "lyz-code-security-advisories@riseup.net",
"security_advisories_email": "lyz-code-security-advisories@riseup.net",
"project_underscore_slug": "autoimport",
"_template": "git@github.com:lyz-code/cookiecutter-python-project.git"
}
},
"directory": null,
"checkout": null
}
autoimport-1.6.0/.github/ 0000775 0000000 0000000 00000000000 14644010763 0015266 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 14644010763 0017451 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/.github/ISSUE_TEMPLATE/bug.md 0000664 0000000 0000000 00000001074 14644010763 0020552 0 ustar 00root root 0000000 0000000 ---
name: Bug
about: Create a bug report to help us improve autoimport
labels: bug
---
## Description
## Steps to reproduce
## Current behavior
## Desired behavior
## Environment
autoimport-1.6.0/.github/ISSUE_TEMPLATE/feature_request.md 0000664 0000000 0000000 00000000735 14644010763 0023203 0 ustar 00root root 0000000 0000000 ---
name: Feature Request
about: Suggest a new feature or change to autoimport
labels: feature request
---
## Description
## Possible Solution
## Additional context
## Related Issue
autoimport-1.6.0/.github/ISSUE_TEMPLATE/question.md 0000664 0000000 0000000 00000000556 14644010763 0021650 0 ustar 00root root 0000000 0000000 ---
name: Question
about: Ask a question about how to use autoimport
labels: question
---
## Question
autoimport-1.6.0/.github/PULL_REQUEST_TEMPLATE.md 0000664 0000000 0000000 00000000354 14644010763 0021071 0 ustar 00root root 0000000 0000000
## Checklist
* [ ] Add test cases to all the changes you introduce
* [ ] Update the documentation for the changes
autoimport-1.6.0/.github/SECURITY.md 0000664 0000000 0000000 00000001322 14644010763 0017055 0 ustar 00root root 0000000 0000000 # Security Policy
## Supported Versions
We will endeavour to support:
* The most recent minor release with bug fixes.
* The latest minor release from the last major version for 6 months after a new
major version is released with critical bug fixes.
* All versions if a security vulnerability is found provided:
* Upgrading to a later version is non-trivial.
* Sufficient people are using that version to make support worthwhile.
## Reporting a Vulnerability
If you find what you think might be a security vulnerability with
autoimport, please do not create an issue on github. Instead please
email lyz-code-security-advisories@riseup.net I'll reply to your email promptly
and try to get a patch out ASAP.
autoimport-1.6.0/.github/workflows/ 0000775 0000000 0000000 00000000000 14644010763 0017323 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/.github/workflows/build.yml 0000664 0000000 0000000 00000002505 14644010763 0021147 0 ustar 00root root 0000000 0000000 ---
name: Build
on: # yamllint disable-line rule:truthy
push:
branches:
- main
workflow_dispatch:
jobs:
PyPI:
name: Build and publish Python distributions to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: pdm-project/setup-pdm@main
name: Setup Python and PDM
with:
python-version: 3.9
- name: Build package
run: make build-package
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
Documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Number of commits to fetch. 0 indicates all history.
# Default: 1
fetch-depth: 0
- uses: pdm-project/setup-pdm@main
name: Setup Python and PDM
with:
python-version: 3.9
- name: Install dependencies
run: make install
- name: Build the Documentation
run: make build-docs
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./site
autoimport-1.6.0/.github/workflows/install.yml 0000664 0000000 0000000 00000001144 14644010763 0021514 0 ustar 00root root 0000000 0000000 ---
name: Install
on: # yamllint disable-line rule:truthy
schedule:
- cron: 21 08 * * *
workflow_dispatch:
jobs:
Install:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install the program
run: pip install autoimport
- name: Test the program works
run: autoimport --version
autoimport-1.6.0/.github/workflows/tests.yml 0000664 0000000 0000000 00000003460 14644010763 0021213 0 ustar 00root root 0000000 0000000 ---
name: Tests
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8, 3.9, '3.10', '3.11']
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
# All these steps are required so that mypy behaves equally than the
# local environment, once mypy supports __pypackages__ try to use the
# github action
pip install virtualenv pdm
virtualenv .venv
source .venv/bin/activate
pdm config python.use_venv True
make install
- name: Test linters
run: make lint
- name: Test type checkers
run: make mypy
- name: Test security
run: make security
- name: Test with pytest
run: make test
- name: Upload Coverage
run: |
pip3 install 'coveralls[toml]'
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true
- name: Test documentation
run: make build-docs
- name: Build the package
run: make build-package
Coveralls:
name: Finish Coveralls
needs: Tests
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
autoimport-1.6.0/.github/workflows/update.yml 0000664 0000000 0000000 00000001750 14644010763 0021333 0 ustar 00root root 0000000 0000000 ---
name: Update
on: # yamllint disable-line rule:truthy
schedule:
- cron: 11 7 * * *
workflow_dispatch:
jobs:
Update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
# All these steps are required so that mypy behaves equally than the
# local environment, once mypy supports __pypackages__ try to use the
# github action
pip install virtualenv pdm
virtualenv .venv
source .venv/bin/activate
pdm config python.use_venv True
- name: Update requirements
run: make update-production
- name: Install the program
run: make install
- name: Run tests
run: make all
autoimport-1.6.0/.gitignore 0000664 0000000 0000000 00000004107 14644010763 0015720 0 ustar 00root root 0000000 0000000 .pdm-python
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
doc/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# End of https://www.toptal.com/developers/gitignore/api/python
.flakeheaven_cache
autoimport-1.6.0/.markdownlint.json 0000664 0000000 0000000 00000000435 14644010763 0017412 0 ustar 00root root 0000000 0000000 {
"default": true,
"MD003": {
"style": "atx"
},
"MD013": {
"line_length": 180
},
"MD004": {
"style": "asterisk"
},
"MD007": {
"indent": 4
},
"MD025": false,
"MD030": false,
"MD035": {
"style": "---"
},
"MD041": false,
"MD046": false
}
autoimport-1.6.0/.pre-commit-config.yaml 0000664 0000000 0000000 00000001436 14644010763 0020213 0 ustar 00root root 0000000 0000000 ---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- id: check-docstring-first
- id: check-merge-conflict
- id: end-of-file-fixer
- repo: https://github.com/ambv/black
rev: 21.12b0
hooks:
- id: black
language_version: python3.7
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910-1
hooks:
- name: Run mypy static analysis tool
id: mypy
args: [--no-warn-unused-ignores, --ignore-missing-imports]
files: src
# - repo: https://github.com/flakehell/flakehell/
# rev: v.0.8.0
# hooks:
# - name: Run flakehell static analysis tool
# id: flakehell
# exclude: index.md
autoimport-1.6.0/.pre-commit-hooks.yaml 0000664 0000000 0000000 00000000321 14644010763 0020061 0 ustar 00root root 0000000 0000000 - id: autoimport
name: autoimport
entry: autoimport
require_serial: true
language: python
language_version: python3
types_or: [cython, pyi, python]
args: []
minimum_pre_commit_version: '2.9.0'
autoimport-1.6.0/CHANGELOG.md 0000664 0000000 0000000 00000010331 14644010763 0015535 0 ustar 00root root 0000000 0000000 ## 1.6.0 (2024-07-11)
## 1.5.0 (2024-05-10)
## 1.4.0 (2023-11-23)
### Feat
- support Python 3.11
### Fix
- drop support for Python 3.7
- switch from pdm-pep517 to pdm-backend
## 1.3.3 (2023-02-08)
### Fix
- handle well comments in from import statements
- remove dependency with py
## 1.3.2 (2022-11-14)
### Fix
- type_checking bug
## 1.3.1 (2022-10-14)
### Fix
- Respect two newlines between code and imports.
- allow imports with dots
## 1.3.0 (2022-10-14)
### Feat
- added --ignore-init-modules flag (fixes #226)
- added __main__.py file (fixes #210)
### Fix
- ignore `if __name__ == "__main__":` lines for coverage
- ignore incorrect no-value-for-parameter lint
- fixed typing issue
## 1.2.3 (2022-09-15)
## 1.2.2 (2022-02-16)
### Perf
- remove the uppercap on python 3.11
## 1.2.1 (2022-02-11)
### Fix
- correct pdm local installation so mypy works
## 1.2.0 (2022-02-09)
## 1.1.1 (2022-02-04)
### Fix
- correct the package building
- correct the package building
## 1.1.0 (2022-02-03)
### Feat
- use pdm to manage dependencies
- use pdm to manage dependencies
- add support for python 3.10
## 1.0.5 (2022-02-03)
## 1.0.4 (2022-01-25)
## 1.0.3 (2022-01-24)
## 1.0.2 (2022-01-21)
### Fix
- don't touch files that are not going to be changed
## 1.0.1 (2022-01-21)
### Fix
- remove empty multiline import statements
## 1.0.0 (2022-01-18)
## 0.11.0 (2021-12-21)
### Feat
- support multi paragraph sections inside the TYPE_CHECKING block
## 0.10.0 (2021-12-08)
### Feat
- cli `--config-file` option
## 0.9.1 (2021-11-30)
### Fix
- support the removal of from x import y as z statements
## 0.9.0 (2021-11-30)
### Feat
- give priority to the common statements over the rest of sources
- added datetime and ModelFactory to the default imports
### feat
- support comments in simple import statementsgn
## 0.8.0 (2021-11-23)
### Feat
- extend common statements
## 0.7.5 (2021-10-22)
### Fix
- ignore unused import statements with noqa autoimport line
## 0.7.4 (2021-10-15)
### Fix
- deprecate python 3.6
## 0.7.3 (2021-08-31)
### Fix
- let autoimport handle empty files
## 0.7.2 (2021-08-20)
### Fix
- avoid RecursionError when searching for packages inside the project
## 0.7.1 (2021-08-20)
### Fix
- prevent autoimport from importing same package many times
## 0.7.0 (2021-04-23)
### Fix
- install wheel in the build pipeline
### feat
- add a ci job to test that the program is installable
### Perf
- add new Enum import alias
## 0.6.1 (2021-02-02)
### Fix
- respect newlines in the header section
### fix
- respect document trailing newline
## 0.6.0 (2021-02-01)
### Fix
- respect shebang and leading comments
### feat
- add BaseModel and Faker to common statements
## 0.5.0 (2021-01-25)
### Feat
- add FrozenDateTimeFactory and suppress import statements
## 0.4.3 (2020-12-29)
### Fix
- respect try except statements in imports
### fix
- remove autoimport from development dependencies
## 0.4.2 (2020-12-29)
### Fix
- wrong import indentation when moving up the imports.
### perf
- common import statements are now run sooner
## 0.4.1 (2020-12-29)
### Fix
- make fix_code respect if TYPE_CHECKING statements
## 0.4.0 (2020-12-17)
### Refactor
- make _find_package_in_our_project a statimethod
### Fix
- import developing package objects when not in src directory
### feat
- import objects defined in the __all__ special variable
## 0.3.0 (2020-12-17)
### Feat
- Add imports of the local package objects
- make autoimport manage the commonly used imports
### Refactor
- move the business logic to the SourceCode entity
### fix
- remove all unused imports instead of just one
## 0.2.2 (2020-12-11)
### Fix
- remove unused imported objects in multiline from import statements
## 0.2.1 (2020-12-10)
### Fix
- support multiline import statements and multiline strings
## 0.2.0 (2020-11-12)
### Feat
- move import statements to the top
### Fix
- **setup.py**: extract the version from source without exec statement
## 0.1.1 (2020-10-27)
### Fix
- correct the formatting of single line module docstrings.
- add newline between module docstring, import statements and code.
## 0.1.0 (2020-10-23)
### Feat
- create first version of the program (#3)
- create initial project structure
autoimport-1.6.0/LICENSE 0000664 0000000 0000000 00000104516 14644010763 0014742 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
autoimport-1.6.0/Makefile 0000664 0000000 0000000 00000011430 14644010763 0015365 0 ustar 00root root 0000000 0000000 .DEFAULT_GOAL := test
isort = pdm run isort --skip tests/assets src tests setup.py
black = pdm run black --exclude assets --target-version py39 src tests
.PHONY: install
install:
pdm install --dev
pdm run pre-commit install
.PHONY: update
update:
@echo "-------------------------"
@echo "- Updating dependencies -"
@echo "-------------------------"
pdm update --no-sync --update-eager
pdm sync --clean
@echo "\a"
.PHONY: update-production
update-production:
@echo "------------------------------------"
@echo "- Updating production dependencies -"
@echo "------------------------------------"
pdm update --production --no-sync --update-eager
pdm sync --clean
@echo "\a"
.PHONY: outdated
outdated:
@echo "-------------------------"
@echo "- Outdated dependencies -"
@echo "-------------------------"
pdm update --dry-run --unconstrained
@echo "\a"
.PHONY: format
format:
@echo "----------------------"
@echo "- Formating the code -"
@echo "----------------------"
$(isort)
$(black)
@echo ""
.PHONY: lint
lint:
@echo "--------------------"
@echo "- Testing the lint -"
@echo "--------------------"
pdm run flakeheaven lint --exclude assets src/ tests/ setup.py
$(isort) --check-only --df
$(black) --check --diff
@echo ""
.PHONY: mypy
mypy:
@echo "----------------"
@echo "- Testing mypy -"
@echo "----------------"
pdm run mypy src tests
@echo ""
.PHONY: test
test: test-code test-examples
@echo "\a"
.PHONY: test-code
test-code:
@echo "----------------"
@echo "- Testing code -"
@echo "----------------"
pdm run pytest --cov-report term-missing --cov src tests ${ARGS}
@echo ""
.PHONY: test-examples
test-examples:
@echo "--------------------"
@echo "- Testing examples -"
@echo "--------------------"
# @find docs/examples -type f -name '*.py' | xargs -I'{}' sh -c 'echo {}; pdm run python {} >/dev/null 2>&1 || (echo "{} failed" ; exit 1)'
@echo ""
# pdm run pytest docs/examples/*
@echo ""
.PHONY: all
all: lint mypy test security build-docs
@echo "\a"
.PHONY: clean
clean:
@echo "---------------------------"
@echo "- Cleaning unwanted files -"
@echo "---------------------------"
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]' `
rm -f `find . -type f -name '*.rej' `
rm -rf `find . -type d -name '*.egg-info' `
rm -rf `find . -type d -name '.mypy_cache' `
rm -f `find . -type f -name '*~' `
rm -f `find . -type f -name '.*~' `
rm -rf .cache
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf htmlcov
rm -f .coverage
rm -f .coverage.*
rm -rf build
rm -rf dist
rm -f src/*.c pydantic/*.so
rm -rf site
rm -rf docs/_build
rm -rf docs/.changelog.md docs/.version.md docs/.tmp_schema_mappings.html
rm -rf codecov.sh
rm -rf coverage.xml
@echo ""
.PHONY: docs
docs: test-examples
@echo "-------------------------"
@echo "- Serving documentation -"
@echo "-------------------------"
pdm run mkdocs serve
@echo ""
.PHONY: bump
bump: pull-main bump-version build-package upload-pypi clean
@echo "\a"
.PHONY: pull-main
pull-main:
@echo "------------------------"
@echo "- Updating repository -"
@echo "------------------------"
git checkout main
git pull
@echo ""
.PHONY: build-package
build-package: clean
@echo "------------------------"
@echo "- Building the package -"
@echo "------------------------"
pdm build
@echo ""
.PHONY: build-docs
build-docs:
@echo "--------------------------"
@echo "- Building documentation -"
@echo "--------------------------"
pdm run mkdocs build --strict
@echo ""
.PHONY: upload-pypi
upload-pypi:
@echo "-----------------------------"
@echo "- Uploading package to pypi -"
@echo "-----------------------------"
twine upload -r pypi dist/*
@echo ""
.PHONY: upload-testing-pypi
upload-testing-pypi:
@echo "-------------------------------------"
@echo "- Uploading package to pypi testing -"
@echo "-------------------------------------"
twine upload -r testpypi dist/*
@echo ""
.PHONY: bump-version
bump-version:
@echo "---------------------------"
@echo "- Bumping program version -"
@echo "---------------------------"
cz bump --changelog --no-verify
git push --tags
git push
@echo ""
.PHONY: version
version:
@python -c "import repository_pattern.version; print(repository_pattern.version.version_info())"
.PHONY: security
security:
@echo "--------------------"
@echo "- Testing security -"
@echo "--------------------"
# Ignoring 70612 (CVE-2019-8341). It is disputed and no fix is apparent, and
# the related dependencies are only used at dev time so do not present as
# great a risk to users of autoimport.
pdm run safety check --ignore 70612
@echo ""
pdm run bandit -r src
@echo ""
.PHONY: release
release:
@echo "----------------------"
@echo "- Generating Release -"
@echo "----------------------"
pdm run cz bump --changelog
@echo ""
autoimport-1.6.0/README.md 0000664 0000000 0000000 00000002572 14644010763 0015213 0 ustar 00root root 0000000 0000000 # Autoimport
[](https://github.com/lyz-code/autoimport/actions)
[](https://github.com/lyz-code/autoimport/actions)
[](https://coveralls.io/github/lyz-code/autoimport?branch=main)
Autoimport missing python libraries.
Throughout the development of a python program you continuously need to manage
the python import statements either because you need one new object or because
you no longer need it. This means that you need to stop writing whatever you
were writing, go to the top of the file, create or remove the import statement
and then resume coding.
This workflow break is annoying and almost always unnecessary. `autoimport`
solves this problem if you execute it whenever you have an import error, for
example by configuring your editor to run it when saving the file.
## Help
See [documentation](https://lyz-code.github.io/autoimport) for more details.
## Installing
```bash
pip install autoimport
```
## Contributing
For guidance on setting up a development environment, and how to make
a contribution to *autoimport*, see [Contributing to
autoimport](https://lyz-code.github.io/autoimport/contributing).
## License
GPLv3
autoimport-1.6.0/docs/ 0000775 0000000 0000000 00000000000 14644010763 0014656 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/adr/ 0000775 0000000 0000000 00000000000 14644010763 0015424 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/adr/001-high_level_problem_analysis.md 0000664 0000000 0000000 00000000000 14644010763 0023763 0 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/adr/002-initial_program_design.md 0000664 0000000 0000000 00000000000 14644010763 0022744 0 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/adr/adr.md 0000664 0000000 0000000 00000001341 14644010763 0016513 0 ustar 00root root 0000000 0000000 [ADR](https://lyz-code.github.io/blue-book/adr/) are short text documents that
captures an important architectural decision made along with its context and
consequences.
```mermaid
graph TD
001[001: High level analysis]
002[002: Initial Program design]
001 -- Extended --> 002
click 001 "https://lyz-code.github.io/autoimport/adr/001-high_level_problem_analysis" _blank
click 002 "https://lyz-code.github.io/autoimport/adr/002-initial_program_design" _blank
001:::draft
002:::draft
classDef draft fill:#CDBFEA;
classDef proposed fill:#B1CCE8;
classDef accepted fill:#B1E8BA;
classDef rejected fill:#E8B1B1;
classDef deprecated fill:#E8B1B1;
classDef superseeded fill:#E8E5B1;
```
autoimport-1.6.0/docs/contributing.md 0000664 0000000 0000000 00000011226 14644010763 0017711 0 ustar 00root root 0000000 0000000 So you've started using `autoimport` and want to show your gratitude to the project,
depending on your programming skills there are different ways to do so.
# I don't know how to program
There are several ways you can contribute:
* [Open an issue](https://github.com/lyz-code/autoimport/issues/new) if you encounter
any bug or to let us know if you want a new feature to be implemented.
* Spread the word about the program.
* Review the [documentation](https://lyz-code.github.io/autoimport) and try to improve
it.
# I know how to program in Python
If you have some python knowledge there are some additional ways to contribute.
We've ordered the [issues](https://github.com/lyz-code/autoimport/issues) in
[milestones](https://github.com/lyz-code/autoimport/milestones), check the issues in
the smaller one, as it's where we'll be spending most of our efforts. Try the
[good first
issues](https://github.com/lyz-code/autoimport/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22),
as they are expected to be easier to get into the project.
We develop the program with
[TDD](https://en.wikipedia.org/wiki/Test-driven_development), so we expect any
contribution to have it's associated tests. We also try to maintain an updated
[documentation](https://lyz-code.github.io/autoimport) of the project, so think if
your contribution needs to update it.
We know that the expected code quality is above average. Therefore it might
be challenging to get the initial grasp of the project structure, know how to make the
tests, update the documentation or use all the project technology stack. but please
don't let this fact discourage you from contributing:
* If you want to develop a new feature, explain how you'd like to do it in the related issue.
* If you don't know how to test your code, do the pull request without the tests
and we'll try to do them for you.
# Issues
Questions, feature requests and bug reports are all welcome as issues.
**To report a security vulnerability, please see our [security
policy](https://github.com/lyz-code/autoimport/security/policy) instead.**
To make it as simple as possible for us to help you, please include the output
of the following call in your issue:
```bash
python -c "import autoimport.version; print(autoimport.version.version_info())"
```
or if you have `make` installed, you can use `make version`.
Please try to always include the above unless you're unable to install `autoimport` or know it's not relevant to your question or
feature request.
# Pull Requests
*autoimport* is released regularly so you should see your
improvements release in a matter of days or weeks.
!!! note
Unless your change is trivial (typo, docs tweak etc.), please create an
issue to discuss the change before creating a pull request.
If you're looking for something to get your teeth into, check out the ["help
wanted"](https://github.com/lyz-code/autoimport/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
label on github.
# Development facilities
To make contributing as easy and fast as possible, you'll want to run tests and
linting locally.
!!! note ""
**tl;dr**: use `make format` to fix formatting, `make` to run tests and linting & `make docs`
to build the docs.
You'll need to have python 3.6, 3.7, or 3.8, virtualenv, git, and make installed.
* Clone your fork and go into the repository directory:
```bash
git clone git@github.com:/autoimport.git
cd autoimport
```
* Set up the virtualenv for running tests:
```bash
virtualenv -p `which python3.7` env
source env/bin/activate
```
* Install autoimport, dependencies and configure the
pre-commits:
```bash
make install
```
* Checkout a new branch and make your changes:
```bash
git checkout -b my-new-feature-branch
```
* Fix formatting and imports: autoimport uses
[black](https://github.com/ambv/black) to enforce formatting and
[isort](https://github.com/timothycrosley/isort) to fix imports.
```bash
make format
```
* Run tests and linting:
```bash
make
```
There are more sub-commands in Makefile like `test-code`, `test-examples`,
`mypy` or `security` which you might want to use, but generally `make`
should be all you need.
If you need to pass specific arguments to pytest use the `ARGS` variable,
for example `make test ARGS='-k test_markdownlint_passes'`.
* Build documentation: If you have changed the documentation, make sure it
builds the static site. Once built it will serve the documentation at
`localhost:8000`:
```bash
make docs
```
* Commit, push, and create your pull request.
We'd love you to contribute to *autoimport*!
autoimport-1.6.0/docs/editor_integration.md 0000664 0000000 0000000 00000001661 14644010763 0021075 0 ustar 00root root 0000000 0000000 For a smoother experience, you can run `autoimport` automatically each
time you save your file in your editor or when you run `git commit`.
# Vim
To integrate `autoimport` into Vim, I recommend using the [ale
plugin](https://github.com/dense-analysis/ale).
!!! note ""
If you are new to ALE, check [this
post](https://lyz-code.github.io/blue-book/linux/vim/vim_plugins/#ale).
`ale` is configured to run `autoimport` automatically by default.
# [pre-commit](https://pre-commit.com/)
You can run `autoimport` before we do a commit using the
[pre-commit](https://pre-commit.com/) framework. If you don't know how to use
it, follow [these
guidelines](https://lyz-code.github.io/blue-book/devops/ci/#configuring-pre-commit).
You'll need to add the following lines to your project's
`.pre-commit-config.yaml` file.
```yaml
repos:
- repo: https://github.com/lyz-code/autoimport/
rev: master
hooks:
- id: autoimport
```
autoimport-1.6.0/docs/index.md 0000664 0000000 0000000 00000022135 14644010763 0016312 0 ustar 00root root 0000000 0000000 [](https://github.com/lyz-code/autoimport/actions)
[](https://github.com/lyz-code/autoimport/actions)
[](https://coveralls.io/github/lyz-code/autoimport?branch=main)
Autoimport missing python libraries.
Throughout the development of a python program you continuously need to manage
the python import statements either because you need one new object or because
you no longer need it. This means that you need to stop writing whatever you
were writing, go to the top of the file, create or remove the import statement
and then resume coding.
This workflow break is annoying and almost always unnecessary. `autoimport`
solves this problem if you execute it whenever you have an import error, for
example by configuring your editor to run it when saving the file.
# Installing
```bash
pip install autoimport
```
# Usage
Imagine we've got the following source code:
```python
import requests
def hello(names: Tuple[str]) -> None:
for name in names:
print(f"Hi {name}!")
os.getcwd()
```
It has the following import errors:
- `requests` is imported but unused.
- `os` and `Tuple` are needed but not imported.
After running `autoimport` the resulting source code will be:
```python
import os
from typing import Tuple
def hello(names: Tuple[str]) -> None:
for name in names:
print(f"Hi {name}!")
os.getcwd()
```
`autoimport` can be used both as command line tool and as a library.
It can be parsed either an array of files and/or a directory.
A parsed directory will have `autoimport` be executed on all recursively found
python files in said directory.
- As a command line tool:
```bash
$: autoimport file.py
$: autoimport dir/
```
- As a library:
```python
from autoimport import fix_files
fix_files(["file.py", "dir/"])
```
Warning: `autoimport` will add all dependencies at the top of the file, we
suggest using [isort](https://pycqa.github.io/isort) and
[black](https://black.readthedocs.io/en/stable/) afterwards to clean the file.
# Features
## Add missing imports
`autoimport` matches each of the missing import statements against the following
objects:
- The modules referenced in `PYTHONPATH`.
- The `typing` library objects.
- The common statements. Where some of the common statements are:
- `BeautifulSoup` -> `from bs4 import BeautifulSoup`
- `call` -> `from unittest.mock import call`
- `CaptureFixture` -> `from _pytest.capture import CaptureFixture`
- `CliRunner` -> `from click.testing import CliRunner`
- `copyfile` -> `from shutil import copyfile`
- `dedent` -> `from textwrap import dedent`
- `LocalPath` -> `from py._path.local import LocalPath`
- `LogCaptureFixture` -> `from _pytest.logging import LogCaptureFixture`
- `Mock` -> `from unittest.mock import Mock`
- `patch` -> `from unittest.mock import patch`
- `StringIO` -> `from io import StringIO`
- `YAMLError` -> `from yaml import YAMLError`
- The objects of the Python project you are developing, assuming you are
executing the program in a directory of the project and you can import it.
Warning: It may not work if you use `pip install -e .`. Given that you execute
`autoimport` inside a virtualenv where the package is installed with
`pip install -e .`, when there is an import error in a file that is indexed in
the package, `autoimport` won't be able to read the package contents as the
`import` statement will fail. So it's a good idea to run autoimport from a
virtualenv that has a stable version of the package we are developing.
## Remove unused import statements
If an object is imported but unused, `autoimport` will remove the import
statement.
This can be problematic when run in `__init__.py` files, which often contain
"unused" imports. To tell `autoimport` to not run on these files, you can use
the `--ignore-init-modules` flag, which will filter away any passed
`__init__.py` files before processing.
There may be import statements that are being used dynamically,
to autoimport it would look like those are not being used but actually they may have some usages.
In such cases where you want to retain the unused imports across any file, you can use the `--keep-unused-imports` flag,
which will prevent `autoimport` from removing any import statements.
**Note:** If there are not many cases where you intend to keep the unused imports, prefer placing
`#noqa: autoimport` on the concerned import line/s, over using the `--keep-unused-imports` flag.
## Moving the imports to the top
There are going to be import cases that may not work, if you find one, please
[open an issue](https://github.com/lyz-code/autoimport/issues/new?labels=bug&template=bug.md).
While we fix it you can write the import statement wherever you are in the file
and the next time you run `autoimport` it will get moved to the top.
If you don't want a specific line to go to the top, add the `# noqa: autoimport`
or `# fmt: skip` at the end. For example:
```python
a = 1
from os import getcwd # noqa: autoimport
getcwd()
```
# Configuration
`autoimport` uses the `maison` library to discover and read your project-local
`pyproject.toml` file (if it exists). This file can be used to configure
`autoimport`'s behavior: the `tool.autoimport.common_statements` table in that
file can be used to define a custom set of "common statements", overriding the
default set of common statements mentioned above. For example:
```toml
# pyproject.toml
[tool.autoimport.common_statements]
"np" = "import numpy as np"
"FooBar" = "from baz_qux import FooBar"
```
It is also possible to specify a different path for this config file:
```bash
$: autoimport --config-file ~/.autoimport.toml file.py
```
If using the `--config-file` flag to specify a file that is named something
other than `pyproject.toml`, the autoimport settings should not be nested under
toplevel `tool.autoimport` keys.
```toml
# .autoimport.toml
[common_statements]
"np" = "import numpy as np"
"FooBar" = "from baz_qux import FooBar"
```
Furthermore, `autoimport` supports the use of a global configuration file,
located at `autoimport/config.toml` under the xdg config home folder. For most
users, this means that the file `~/.config/autoimport/config.toml`, if it
exists, will be loaded and used as configuration for `autoimport`. As before, do
not write `tool.autoimport` at the toplevel; just specify your global
`autoimport` settings directly.
The settings defined in the local `pyproject.toml` file (if found) or in the
file specified by the `--config-file` flag (if given) will override the settings
defined in the global `autoimport/config.toml` file.
## Disabling Move To Top
While discouraged in favor of proper refactoring to eliminate cyclical
dependencies, it is possible to disable autoimport from moving import statements
to the tops of the files.
To do so, set `disable_move_to_top` to `true`. Here is how that might look in a
`pyproject.toml` configuration file.
```toml
[tool.autoimport]
disable_move_to_top = true
```
# References
As most open sourced programs, `autoimport` is standing on the shoulders of
giants, namely:
- [autoflake](https://pypi.org/project/autoflake/): Inspiration of `autoimport`.
Also used their code to interact with
- [pyflakes](https://pypi.org/project/pyflakes/).
- [Click](https://click.palletsprojects.com/): Used to create the command line
interface.
- [Pytest](https://docs.pytest.org/en/latest): Testing framework, enhanced by
the awesome [pytest-cases](https://smarie.github.io/python-pytest-cases/)
library that made the parametrization of the tests a lovely experience.
- [Mypy](https://mypy.readthedocs.io/en/stable/): Python static type checker.
- [Flakeheaven](https://github.com/flakeheaven/flakeheaven): Python linter with
[lots of checks](https://lyz-code.github.io/blue-book/devops/flakeheaven#plugins).
- [Black](https://black.readthedocs.io/en/stable/): Python formatter to keep a
nice style without effort.
- [Autoimport](https://lyz-code.github.io/autoimport): Python formatter to
automatically fix wrong import statements.
- [isort](https://github.com/timothycrosley/isort): Python formatter to order
the import statements.
- [PDM](https://pdm.fming.dev/): Command line tool to manage the dependencies.
- [Mkdocs](https://www.mkdocs.org/): To build this documentation site, with the
- [Material theme](https://squidfunk.github.io/mkdocs-material).
- [Safety](https://github.com/pyupio/safety): To check the installed
dependencies for known security vulnerabilities.
- [Bandit](https://bandit.readthedocs.io/en/latest/): To finds common security
issues in Python code.
- [Yamlfix](https://github.com/lyz-code/yamlfix): YAML fixer.
# Alternatives
If you like the idea but not how we solved the problem, take a look at this
other solutions:
- [smart-imports](https://github.com/Tiendil/smart-imports)
# Contributing
For guidance on setting up a development environment, and how to make a
contribution to *autoimport*, see
[Contributing to autoimport](https://lyz-code.github.io/autoimport/contributing).
autoimport-1.6.0/docs/reference.md 0000664 0000000 0000000 00000000114 14644010763 0017132 0 ustar 00root root 0000000 0000000 ::: autoimport.services
::: autoimport.entrypoints
::: autoimport.version
autoimport-1.6.0/docs/stylesheets/ 0000775 0000000 0000000 00000000000 14644010763 0017232 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/stylesheets/extra.css 0000664 0000000 0000000 00000001302 14644010763 0021063 0 ustar 00root root 0000000 0000000 .md-content a:link {
text-decoration:underline;
}
.md-typeset a:hover {
color: #abb9c1;
text-decoration:underline;
}
.md-typeset h1 {
font-size: 32px;
font-family: Content-font, Roboto, sans-serif;
font-weight: 500;
line-height: 1.5;
color: #28292d;
}
.md-typeset h1::after {
width:93%;
height:2px;
background: #283551;
content:"";
display: block;
margin-top: 1px;
opacity: 0.3;
}
.md-typeset h2 {
font-size: 24px;
font-family: Content-font, Roboto, sans-serif;
font-weight: 700;
line-height: 1.5;
color: #28292d;
}
.md-typeset h2::after {
width:100%;
height:1px;
background: #283551;
content:"";
display: block;
margin-top: -5px;
opacity: 0.2;
}
autoimport-1.6.0/docs/stylesheets/links.css 0000664 0000000 0000000 00000123617 14644010763 0021076 0 ustar 00root root 0000000 0000000 /*=-----------------------------------------=*/
/*= Icons for certain link types: by target =*/
/*=-----------------------------------------=*/
/* Within-page (anchor) links.
*/
/*
.md-content section > :not(:first-child) a[href^='#']::after,
.md-content p a[href^='#']::after {
content: "\00B6";
margin: 0 1px 0 3px;
font-size: 0.75em;
vertical-align: baseline;
position: relative;
bottom: 0.45em;
opacity: 0.6;
}
.md-content section > :not(:first-child) a[href^='#'].footnote-ref::after,
.md-content p a[href^='#'].footnote-ref::after,
.md-content section > :not(:first-child) a[href^='#'].footnote-back::after,
.md-content p a[href^='#'].footnote-back::after {
content: none;
}
*/
/* Internal (within-site) links. Avoid 'G' icons on hosted documents, local images, and infrastructure, which aren't formal writings.
*/
.md-content a[href^="https://www.gwern.net/"]:not([href*="/docs/"]):not([href*="/images/"]):not([href*="/static/"]):not([href$=".hs"]):not([href$=".sh"]):not([href$=".R"])::after {
content: "\1D50A"; /* Gothic G */
margin: 0 0 0 2px;
vertical-align: baseline;
position: relative;
bottom: 0.15em;
opacity: 0.55;
}
/* TEXTUAL PER-DOMAIN LINK ICONS: */
/* Common style */
.md-content a[href*="17th-angel.tumblr.com"]::after,
.md-content a[href*="andrewgelman.com"]::after,
.md-content a[href*="animenewsnetwork.com"]::after,
.md-content a[href*="arstechnica.com"]::after,
.md-content a[href*="arxiv.org"]::after,
.md-content a[href*="bbc.com"]::after,
.md-content a[href*="bbc.co.uk"]::after,
.md-content a[href*="www.cdc.gov"]::after,
.md-content a[href*="www.vox.com"]::after,
.md-content a[href*="www.vanityfair.com"]::after,
.md-content a[href*="www.motherjones.com"]::after,
.md-content a[href*="www.edge.org"]::after,
.md-content a[href*="bitcointalk.org"]::after,
.md-content a[href*="bitcoin.t"]::after,
.md-content a[href*="bloomberg.com"]::after,
.md-content a[href*="bmj.com"]::after,
.md-content a[href*="economist.com"]::after,
.md-content a[href*="evageeks.org"]::after,
.md-content a[href*="evamonkey.com"]::after,
.md-content a[href*="evaotaku.com"]::after,
.md-content a[href*="www.fanfiction.net"]::after,
.md-content a[href*="fda.gov"]::after,
.md-content a[href*="filfre.net"]::after,
.md-content a[href*="gainax.co.jp"]::after,
.md-content a[href*="goodreads.com"]::after,
.md-content a[href*="haskell.org"]::after,
.md-content a[href*="harney.com"]::after,
.md-content a[href*="justice.gov"]::after,
.md-content a[href*="khara.co.jp"]::after,
.md-content a[href*="kk.org"]::after,
.md-content a[href*="lesswrong.com"]::after,
.md-content a[href*="longbets.org"]::after,
.md-content a[href*="longnow.org"]::after,
.md-content a[href*="marginalrevolution.com"]::after,
.md-content a[href*="medium.com"]::after,
.md-content a[href*="myanimelist.net"]::after,
.md-content a[href*="nature.com"]::after,
.md-content a[href*="onegeek.org"]::after,
.md-content a[href*="overcomingbias.com"]::after,
.md-content a[href*="pnas.org"]::after,
.md-content a[href*="poniesatdawn.bandcamp.com"]::after,
.md-content a[href*="predictionbook.com"]::after,
.md-content a[href*="r-project.org"]::after,
.md-content a[href*="rosettaproject.org"]::after,
.md-content a[href*="rstudio.com"]::after,
.md-content a[href*="salon.com"]::after,
.md-content a[href*="sciencemag.org"]::after,
.md-content a[href*="sciencedirect.com"]::after,
.md-content a[href*="scholars-stage.blogspot.com"]::after,
.md-content a[href*="slate.com"]::after,
.md-content a[href*="slatestarcodex"]::after,
.md-content a[href*="statmodeling.stat.columbia.edu"]::after,
.md-content a[href*="t.umblr.com"]::after,
.md-content a[href*="technologyreview.com"]::after,
.md-content a[href*="theatlantic.com"]::after,
.md-content a[href*="theinterval.org"]::after,
.md-content a[href*="theparisreview.org"]::after,
.md-content a[href*="tinyletter.com"]::after,
.md-content a[href*="www.mail-archive.com"]::after,
.md-content a[href*="groups.google.com"]::after,
.md-content a[href*="tumblr.com"]::after,
.md-content a[href*="tvtropes.org"]::after,
.md-content a[href*="urth.net"]::after,
.md-content a[href*="www.nber.org"]::after,
.md-content a[href*="mlp.fandom.com"]::after,
.md-content a[href*="www.wsj.com"]::after,
.md-content a[href*="www.google.com"]::after,
.md-content a[href*="wiley.com"]::after,
.md-content a[href*="yunnansourcing.com"]::after,
.md-content a[href*="yvain"]::after,
.md-content a[href*="unsongbook.com"]::after,
.md-content a[href*="groups.yahoo.com"]::after,
.md-content a[href*="publicdomainreview.org"]::after,
.md-content a[href*="meltingasphalt.com"]::after,
.md-content a[href*="neweva.blog103.fc2.com"]::after {
font-size: 0.8em;
font-weight: 600;
margin: 0 0 0 2px;
vertical-align: baseline;
position: relative;
bottom: 0.2em;
opacity: 0.6;
}
/* MR: cheaper to abuse Unicode */
.md-content a[href*="marginalrevolution.com"]::after {
content: "Mð‘"; }
/* likewise */
.md-content a[href*="medium.com"]::after {
content: "ðŒ"; }
/* Kevin Kelly */
.md-content a[href*="kk.org"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "KK"; }
/* Google searches, other tools; note that there are many Google subdomains, so we narrow down with just 'www' */
.md-content a[href*="www.google.com"]::after {
content: "ð†"; }
/* Wiley & Sons's 'W' unfortunately overlaps with the WP 'W' but if we sans it, maybe that'll help */
.md-content a[href*="wiley.com"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "W"; }
/* PNAS: they don't have a real logo, but their favicon does a nice little compact square, and we can replicate that in CSS: */
.md-content a[href*="pnas.org"]::after {
content: "PNAS";
font-size: 0.5em;
width: 1.4em;
display: inline-block;
overflow-wrap: break-word;
font-family: Baskerville;
line-height: 0.7;
text-align: center;
position: relative;
bottom: 0.3em;
left: 0.1em; }
.md-content a[href*="www.nber.org"]:not([href$=".pdf"])::after {
content: "NBER";
font-size: 0.5em;
width: 1.35em;
display: inline-block;
overflow-wrap: break-word;
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
font-style: italic;
line-height: 0.7;
text-align: center;
position: relative;
bottom: 0.3em;
left: 0.1em; }
.md-content a[href*="mlp.fandom.com"]::after {
content: "MLPW";
font-size: 0.5em;
width: 1.35em;
display: inline-block;
overflow-wrap: break-word;
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
font-style: italic;
line-height: 0.7;
text-align: center;
position: relative;
bottom: 0.3em;
left: 0.1em; }
.md-content a[href*="publicdomainreview.org"]::after {
content: "TPDR";
font-size: 0.5em;
width: 1.6em;
display: inline-block;
overflow-wrap: break-word;
font-family: Baskerville;
line-height: 0.8em;
text-align: center;
position: relative;
bottom: 0.3em;
left: 0.1em; }
.md-content a[href*="meltingasphalt.com"]::after {
content: "▲▲△"; }
/* Bitcoin Talk: close enough! */
.md-content a[href*="bitcointalk.org"]::after,
.md-content a[href*="bitcoin.it"]::after {
content: "â‚¿âƒ"; }
.md-content a[href*="salon.com"]::after {
content: "s"; }
.md-content a[href*="www.vox.com"]::after {
font-style: italic;
content: "Vox"; }
.md-content a[href*="www.vanityfair.com"]::after {
content: "VF"; }
.md-content a[href*="www.motherjones.com"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "MJ"; }
.md-content a[href*="www.edge.org"]::after {
font-style: italic;
content: "E"; }
/* The Harney & Sons logo is too fancy to scale down reasonably */
.md-content a[href*="harney.com"]::after {
content: "H"; }
/* The FF.net logo is pretty crazy, and I don't think anyone would recognize it in monochrome */
.md-content a[href*="www.fanfiction.net"]::after {
content: "FF"; }
.md-content a[href*="poniesatdawn.bandcamp.com"]::after {
content: "P@D"; }
.md-content a[href*="yunnansourcing.com"]::after {
content: "ʸₛ"; }
/* Avoid the unfortunate connotations of 'SS' */
.md-content a[href*="scholars-stage.blogspot.com"]::after {
content: "Ss"; }
/* Ars is an orange box, not usable */
.md-content a[href*="arstechnica.com"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "ars"; }
/* British Medical Journal or just 'bmj' */
.md-content a[href*="bmj.com"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "bmj"; }
/* Science is just typeset in red */
.md-content a[href*="sciencemag.org"]::after {
content: "S"; }
/* SSC logo too bad to use */
.md-content a[href*="yvain"]::after,
.md-content a[href*="slatestarcodex"]::after {
content: "SSC"; }
/* SSC's book */
.md-content a[href*="unsongbook.com"]::after {
content: "×"; }
/* OB logo too bad to use */
.md-content a[href*="overcomingbias.com"]::after {
content: "OB"; }
/* LW logo is just a colored 'LW', so no point in converting */
.md-content a[href*="lesswrong.com"]::after {
content: "LW"; }
/* PB logo is confusing. A purple question mark...? */
.md-content a[href*="predictionbook.com"]::after {
content: "\FE56"; }
/* GoodReads: logo doesn't make sense as a grayscale */
.md-content a[href*="goodreads.com"]::after {
content: "GR"; }
/* Long Now Foundation projects: */
.md-content a[href*="longbets.org"]::after,
.md-content a[href*="longnow.org"]::after,
.md-content a[href*="rosettaproject.org"]::after,
.md-content a[href*="theinterval.org"]::after {
content: "X";
text-decoration: overline; }
/* ArXiv: Chi (their logo is too bad to use) */
.md-content a[href*="arxiv.org"]::after {
content: "\1D6D8"; }
/* Technology Review (their logo has a little slash in it which you probably can't see at low-res) but is otherwise just a 'T' so meh */
.md-content a[href*="technologyreview.com"]::after {
content: "T";
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif; }
/* Economist: logo is just 'Economist'... */
.md-content a[href*="economist.com"]::after {
content: "E";
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif; }
/* Elsevier/Sciencedirect.com: also an 'E' */
.md-content a[href*="sciencedirect.com"]::after {
content: "E";
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif; }
/* Favicon is a little normal distribution/histogram */
.md-content a[href*="andrewgelman.com"]::after,
.md-content a[href*="statmodeling.stat.columbia.edu"]::after {
content: "▅▇▃";
font-size: 0.6em; }
/* Bloomberg: no usable logo, just an inset-B */
.md-content a[href*="bloomberg.com"]::after {
content: "ð"; }
/* BBC: no usable logo */
.md-content a[href*="bbc.com"]::after,
.md-content a[href*="bbc.co.uk"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "BBC"; }
/* R: at this point R Studio has taken over a lot of control, so might as well treat them as official too... */
.md-content a[href*="r-project.org"]::after,
.md-content a[href*="rstudio.com"]::after {
content: "R";
}
/* Haskell: simplify logo; the double-lambda is too busy when used for link icons */
.md-content a[href*="haskell.org"]::after {
content: "ð›Œ"; }
/* MAL: the blue of their logo doesn't work, so just text */
.md-content a[href*="myanimelist.net"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "MAL"; }
/* Gene Wolfe mailing list; no logo */
.md-content a[href*="urth.net"]::after {
content: "U"; }
/* TinyLetter's icon, without color, isn't memorable enough; throw in the other email services */
.md-content a[href*="tinyletter.com"]::after,
.md-content a[href*="groups.google.com"]::after,
.md-content a[href*="groups.yahoo.com"]::after,
.md-content a[href*="www.mail-archive.com"]::after {
content: "✉"; }
/* Tumblr: turns out there's a Unicode equivalent to their curly-T which can be used instead */
.md-content a[href*="tumblr.com"]::after,
.md-content a[href*="t.umblr.com"]::after {
content: "ʈ"; }
/* The Atlantic: replicate sloping by italics */
.md-content a[href*="theatlantic.com"]::after {
font-style: italic;
content: "A"; }
/* Filfre.net/The Digital Antiquarian has no logo or usable substitue... */
.md-content a[href*="filfre.net"]::after {
content: "F"; }
/* ANN */
.md-content a[href*="animenewsnetwork.com"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "ANN"; }
/* TV Tropes: their lampshade icon is unrecognizable & hard to see small */
.md-content a[href*="tvtropes.org"]::after {
content: "TV"; }
.md-content a[href*="www.cdc.gov"]::after {
content: "CDC"; }
/* US federal Department of Justice */
.md-content a[href*="justice.gov"]::after {
content: "DoJ"; }
/* FDA/Food & Drug Agency */
.md-content a[href*="fda.gov"]::after {
font-family: "Lucida Sans Unicode", "Source Sans Pro", Helvetica, "Trebuchet MS", sans-serif;
content: "FDA"; }
/* The Paris Review: not even going to try to make their weird bird logo work */
.md-content a[href*="theparisreview.org"]::after {
content: "PR"; }
/* The Wall Street Journal */
.md-content a[href*="www.wsj.com"]::after {
content: "WSJ"; }
/* Slate */
.md-content a[href*="slate.com"]::after {
content: "S"; }
/* Nature */
.md-content a[href*="nature.com"]::after {
content: "n"; }
/* Evangelion: we'll split this into EGF-related and other NGE sites */
.md-content a[href*="evageeks.org"]::after,
.md-content a[href*="evamonkey.com"]::after {
content: "EG"; }
.md-content a[href*="onegeek.org"]::after,
.md-content a[href*="evaotaku.com"]::after,
.md-content a[href*="khara.co.jp"]::after,
.md-content a[href*="gainax.co.jp"]::after,
.md-content a[href*="17th-angel.tumblr.com"]::after,
.md-content a[href*="neweva.blog103.fc2.com"]::after {
content: "NGE"; }
/* IMAGE-BASED PER-DOMAIN LINK ICONS: */
/* BioRxiv (custom icon: italic Chi with DNA cross-strands) */
.md-content a[href*='biorxiv.org']::after {
background-image: url("/autoimport/assets/images/chi-dna.svg");
}
.md-content a[href*='biorxiv.org']:hover::after {
opacity: 0.3;
}
.md-content a[href*='biorxiv.org']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 0.9em;
margin: 0 0 0 2px;
opacity: 0.60;
}
/* Google Scholar */
.md-content a[href*='scholar.google.com']::after {
background-image: url("/autoimport/assets/images/google-scholar.svg");
}
.md-content a[href*='scholar.google.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='scholar.google.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 1em;
margin: 0 0 0 2px;
opacity: 0.60;
}
/* PLOS ONE in all their domain permutations... */
.md-content a[href*='plosone.org']::after,
.md-content a[href*='plos.org']::after,
.md-content a[href*='www.plos']::after {
background-image: url("/autoimport/assets/images/plos.svg");
}
.md-content a[href*='plosone.org']:hover::after,
.md-content a[href*='plos.org']:hover::after,
.md-content a[href*='www.plos']:hover::after {
opacity: 0.3;
}
.md-content a[href*='plosone.org']::after,
.md-content a[href*='plos.org']::after,
.md-content a[href*='www.plos']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1.1em;
width: 1em;
margin: 0 0 1px 3px;
opacity: 0.50;
}
/* Patreon: used the old one (https://upload.wikimedia.org/wikipedia/commons/9/94/Patreon_logo.svg) because I don't like the new one */
.md-content a[href*='patreon.com']::after {
background-image: url("/autoimport/assets/images/patreon.svg");
}
.md-content a[href*='patreon.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='patreon.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1.1em;
width: 1em;
margin: 0 0 0 2px;
opacity: 0.60;}
/* Upton Tea */
.md-content a[href*='uptontea.com']::after {
background-image: url("/autoimport/assets/images/uptontea.svg");
}
.md-content a[href*='uptontea.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='uptontea.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1.1em;
width: 1em;
margin: 0 0 0 2px;
opacity: 0.60;}
/* Wired */
.md-content a[href*='wired.com']::after {
background-image: url("/autoimport/assets/images/wired.svg");
}
.md-content a[href*='wired.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='wired.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 3px;
opacity: 0.50;
}
/* The Washington Post: truncated their blackletter to 'WP' */
.md-content a[href*='washingtonpost.com']::after {
background-image: url("/autoimport/assets/images/washingtonpost.svg");
}
.md-content a[href*='washingtonpost.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='washingtonpost.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 1em;
margin: 0 0 0px 3px;
opacity: 0.60;
}
/* The New York Times: reduction of full SVG logo to just the 'T' they use as an icon */
.md-content a[href*='nytimes.com']::after {
background-image: url("/autoimport/assets/images/newyorktimes.svg");}
.md-content a[href*='nytimes.com']:hover::after {
opacity: 0.45;
}
.md-content a[href*='nytimes.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 0.8em;
margin:0 0 2px 3px;
opacity: 0.60;
}
/* NCBI/Pubmed: simplification of their logo (https://upload.wikimedia.org/wikipedia/commons/0/07/US-NLM-NCBI-Logo.svg) */
.md-content a[href*='nlm.nih.gov']::after {
background-image: url("/autoimport/assets/images/nlm-ncbi.svg");
}
.md-content a[href*='nlm.nih.gov']:hover::after {
opacity: 0.45;
}
.md-content a[href*='nlm.nih.gov']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 0.8em;
margin:0 0 2px 3px;
opacity: 0.60;
}
/* The New Yorker: the Dandy SVG, simplified & rotated more vertically */
.md-content a[href*='newyorker.com']::after {
background-image: url("/autoimport/assets/images/thenewyorker.svg");
}
.md-content a[href*='newyorker.com']:hover::after {
opacity: 0.45;
}
.md-content a[href*='newyorker.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1.3em;
width: 0.9em;
margin: 0 0 0px 2px;
opacity: 0.60;
}
/* El Grauniad */
.md-content a[href*='theguardian.com']::after,
.md-content a[href*='www.guardian.co.uk']::after {
background-image: url("/autoimport/assets/images/theguardian.svg");
}
.md-content a[href*='theguardian.com']:hover::after,
.md-content a[href*='www.guardian.co.uk']:hover::after {
opacity: 0.3;
}
.md-content a[href*='theguardian.com']::after,
.md-content a[href*='www.guardian.co.uk']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1.1em;
width: 1em;
margin: 0 0 0 2px;
opacity: 0.60;
}
/* Reddit */
.md-content a[href*='reddit.com']::after {
background-image: url("/autoimport/assets/images/reddit.svg");
}
.md-content a[href*='reddit.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='reddit.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 3px;
opacity: 0.50;
}
/* PG/HN/YC (shared logo): */
.md-content a[href*='paulgraham.com']::after,
.md-content a[href*='ycombinator.com']::after {
background-image: url("/autoimport/assets/images/hn.svg");
}
.md-content a[href*='paulgraham.com']:hover::after,
.md-content a[href*='ycombinator.com']:hover::after {
opacity: 0.4;
}
.md-content a[href*='paulgraham.com']::after,
.md-content a[href*='ycombinator.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 0 4px;
opacity: 0.60;
}
/* MIRI/intelligence.org */
.md-content a[href*='intelligence.org']::after {
background-image: url("/autoimport/assets/images/miri.svg");
}
.md-content a[href*='intelligence.org']:hover::after {
opacity: 0.3;
}
.md-content a[href*='intelligence.org']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 1em;
margin: 0 0 0 2px;
opacity: 0.60;
}
/* DeepMind; match articles or anchors about DM too */
.md-content a[href*='deepmind']::after {
background-image: url("/autoimport/assets/images/deepmind.svg");
}
.md-content a[href*='deepmind']:hover::after {
opacity: 0.5;
}
.md-content a[href*='deepmind']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1.1em;
width: 1.1em;
margin: 0 0 1px 4px;
opacity: 0.60;
}
.md-content a[href*='openai']::after {
background-image: url("/autoimport/assets/images/openai.svg");
}
.md-content a[href*='openai']:hover::after {
opacity: 0.5;
}
.md-content a[href*='openai']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1.1em;
width: 1em;
margin: 0 0 0px 3px;
opacity: 0.60;
}
/* Twitter */
.md-content a[href*='twitter.com']::after {
background-image: url("/autoimport/assets/images/twitter.svg");
}
.md-content a[href*='twitter.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='twitter.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 4px;
opacity: 0.60;
}
/* Erowid */
.md-content a[href*='erowid.org']::after {
background-image: url("/autoimport/assets/images/erowid.svg");
}
.md-content a[href*='erowid.org']:hover::after {
opacity: 0.3;
}
.md-content a[href*='erowid.org']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 1em;
margin: 0 0 0 2px;
opacity: 0.60;
}
/* Wikipedia */
.md-content a[href*="wikipedia.org"]::after,
.md-content a[href*="wikimedia.org"]::after,
.md-content a[href*="wikimediafoundation.org"]::after,
.md-content a[href*="wikisource.org"]::after {
content: "";
/* WP is used on almost every page, so make an exception and inline it */
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNTEyIj48cGF0aCBkPSJNNjQwIDUxLjJsLS4zIDEyLjJjLTI4LjEuOC00NSAxNS44LTU1LjggNDAuMy0yNSA1Ny44LTEwMy4zIDI0MC0xNTUuMyAzNTguNkg0MTVsLTgxLjktMTkzLjFjLTMyLjUgNjMuNi02OC4zIDEzMC05OS4yIDE5My4xLS4zLjMtMTUgMC0xNS0uM0MxNzIgMzUyLjMgMTIyLjggMjQzLjQgNzUuOCAxMzMuNCA2NC40IDEwNi43IDI2LjQgNjMuNC4yIDYzLjdjMC0zLjEtLjMtMTAtLjMtMTQuMmgxNjEuOXYxMy45Yy0xOS4yIDEuMS01Mi44IDEzLjMtNDMuMyAzNC4yIDIxLjkgNDkuNyAxMDMuNiAyNDAuMyAxMjUuNiAyODguNiAxNS0yOS43IDU3LjgtMTA5LjIgNzUuMy0xNDIuOC0xMy45LTI4LjMtNTguNi0xMzMuOS03Mi44LTE2MC05LjctMTcuOC0zNi4xLTE5LjQtNTUuOC0xOS43VjQ5LjhsMTQyLjUuM3YxMy4xYy0xOS40LjYtMzguMSA3LjgtMjkuNCAyNi4xIDE4LjkgNDAgMzAuNiA2OC4xIDQ4LjEgMTA0LjcgNS42LTEwLjggMzQuNy02OS40IDQ4LjEtMTAwLjggOC45LTIwLjYtMy45LTI4LjYtMzguNi0yOS40LjMtMy42IDAtMTAuMy4zLTEzLjYgNDQuNC0uMyAxMTEuMS0uMyAxMjMuMS0uNnYxMy42Yy0yMi41LjgtNDUuOCAxMi44LTU4LjEgMzEuN2wtNTkuMiAxMjIuOGM2LjQgMTYuMSA2My4zIDE0Mi44IDY5LjIgMTU2LjdMNTU5LjIgOTEuOGMtOC42LTIzLjEtMzYuNC0yOC4xLTQ3LjItMjguM1Y0OS42bDEyNy44IDEuMS4yLjV6Ii8+PC9zdmc+');
background-repeat: no-repeat;
background-size: 0.75em;
background-position: right 1px top;
width: 0.825em;
height: 0.825em;
display: inline-block;
vertical-align: baseline;
opacity: 0.825;
}
.md-content a[href*="wikipedia.org"]:hover::after,
.md-content a[href*="wikimedia.org"]:hover::after,
.md-content a[href*="wikimediafoundation.org"]:hover::after,
.md-content a[href*="wikisource.org"]:hover::after {
opacity: 0.6;
}
/* YouTube/Bandcamp/SoundCloud links */
.md-content a[href*='youtube.com']::after,
.md-content a[href*='youtu.be']::after,
.md-content a[href*='soundcloud.com']::after,
.md-content a[href*='bandcamp.com']::after {
background-image: url('/autoimport/assets/images/video.svg');
}
.md-content a[href*='youtube.com']:hover::after,
.md-content a[href*='youtu.be']:hover::after,
.md-content a[href*='soundcloud.com']:hover::after,
.md-content a[href*='bandcamp.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='youtube.com']::after,
.md-content a[href*='youtu.be']::after,
.md-content a[href*='soundcloud.com']::after,
.md-content a[href*='bandcamp.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 1em;
width: 1em;
margin: 0 0 0 3px;
opacity: 0.60;
}
/* The *Exchange/*Overflow family of websites: */
.md-content a[href*="overflow.net"]::after,
.md-content a[href*="overflow.com"]::after,
.md-content a[href*="stackexchange.com"]::after {
content: "";
background-image: url("/autoimport/assets/images/stackexchange.svg");
background-repeat: no-repeat;
background-size: 0.75em;
background-position: right 1px top;
width: 0.85em;
height: 0.85em;
display: inline-block;
vertical-align: baseline;
opacity: 0.85;
}
.md-content a[href*="overflow.net"]:hover::after,
.md-content a[href*="overflow.com"]::after,
.md-content a[href*="stackexchange.com"]:hover::after {
opacity: 0.6;
}
/* Amazon */
.md-content a[href*="amazon.com"]::after,
.md-content a[href*="amazon.co."]::after,
.md-content a[href*="amzn.com"]::after {
content: "";
background-image: url("/autoimport/assets/images/amazon.svg");
background-repeat: no-repeat;
background-size: 0.75em;
background-position: right 1px top;
width: 1em;
height: 0.8em;
display: inline-block;
vertical-align: baseline;
opacity: 0.81;
}
.md-content a[href*="amazon.com"]:hover::after,
.md-content a[href*="amazon.co."]:hover::after,
.md-content a[href*="amzn.com"]:hover::after {
opacity: 0.6;
}
/* Blue book: Fetch all internal links not `//` and the external links of my
* blog */
.md-content a[href*='lyz-code.github.io']::after,
.md-content a:not([href*="//"])::after {
background-image: url("/autoimport/assets/images/pydo.svg");
}
.md-content a[href*='lyz-code.github.io']:hover::after,
.md-content a:not([href*="//"])::after {
opacity: 0.3;
}
.md-content a[href*='lyz-code.github.io']::after,
.md-content a:not([href*="//"])::after {
content: "";
display: inline-block;
position: static;
margin: 0 0 2px 3px;
background-repeat: no-repeat;
background-size: 0.75em;
background-position: right 1px top;
width: 0.825em;
height: 0.825em;
display: inline-block;
vertical-align: baseline;
opacity: 0.5;
}
.md-content a[href*='mailto']::after,
.md-content a[title='Permanent link'] {
text-decoration: none;
}
.md-content a[href*='mailto']::after,
.md-content a[title='Permanent link']::after {
opacity: 0;
width: 0;
}
/* Gitea */
.md-content a[href*='git.digitales.cslabrecha.org']::after {
background-image: url("/autoimport/assets/images/gitea.svg");
}
.md-content a[href*='git.digitales.cslabrecha.org']:hover::after {
opacity: 0.3;
}
.md-content a[href*='git.digitales.cslabrecha.org']::after {
content: "";
display: inline-block;
position: static;
margin: 0 0 2px 3px;
background-repeat: no-repeat;
background-size: 0.75em;
background-position: right 1px top;
width: 0.825em;
height: 0.825em;
display: inline-block;
vertical-align: baseline;
opacity: 0.60;
}
/* Github; I exclude github.io because that's blogs */
.md-content a[href*='github.com']::after {
background-image: url("/autoimport/assets/images/github.svg");
}
.md-content a[href*='github.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='github.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 3px;
opacity: 0.60;
}
.md-content a[title='Edit this page'] {
text-decoration: none;
}
.md-content a[title='Edit this page']::after {
opacity: 0;
}
/* Dropbox: old file-host, deprecated since they've started killing inactive accounts */
.md-content a[href*='dropbox.com']::after,
.md-content a[href*='dropboxusercontent.com']::after {
background-image: url("/autoimport/assets/images/dropbox.svg");
}
.md-content a[href*='dropbox.com']:hover::after,
.md-content a[href*='dropboxusercontent.com']:hover::after {
opacity: 0.3;
}
.md-content a[href*='dropbox.com']::after,
.md-content a[href*='dropboxusercontent.com']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 3px;
opacity: 0.50;
}
/* Kubernetes docs */
.md-content a[href*='kubernetes.io']::after {
background-image: url("/autoimport/assets/images/kubernetes.svg");
opacity: 1;
}
.md-content a[href*='kubernetes.io']:hover::after {
opacity: 0.3;
}
.md-content a[href*='kubernetes.io']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 3px;
opacity: 0.60;
}
/* MegaUpload/Mega: filesharing (used for big files) */
.md-content a[href*='mega.nz']::after {
background-image: url("/autoimport/assets/images/mega.svg");
}
.md-content a[href*='mega.nz']:hover::after {
opacity: 0.3;
}
.md-content a[href*='mega.nz']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 3px;
opacity: 0.60;
}
.md-content a[href*='archive.org']::after,
.md-content a[href*='archive-it.org']::after,
.md-content a[href*='archiveteam.org']::after,
.md-content a[href*='waybackmachine.org']::after {
background-image: url("/autoimport/assets/images/internetarchive.svg");
}
.md-content a[href*='archive.org']:hover::after,
.md-content a[href*='archive-it.org']:hover::after,
.md-content a[href*='archiveteam.org']:hover::after,
.md-content a[href*='waybackmachine.org']:hover::after {
opacity: 0.3;
}
.md-content a[href*='archive.org']::after,
.md-content a[href*='archive-it.org']::after,
.md-content a[href*='archiveteam.org']::after,
.md-content a[href*='waybackmachine.org']::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 2px 3px;
opacity: 0.60;
}
/*=--------------------------------------------=*/
/*= Icons for certain link types: by file type =*/
/*=--------------------------------------------=*/
/* Note: some file extension link types have are selected additionally by
origin on gwern.net, because they frequently appear at the ends of ordinary
web page URLs.
*/
/* PDFs */
.md-content a[href$='.pdf' i]::after,
.md-content a[href$='/pdf' i]::after,
.md-content a[href$='type=pdf' i]::after,
.md-content a[href*='.pdf#' i]::after,
.md-content a[href*='pdfs.semanticscholar.org' i]::after,
.md-content a[href$='.epub' i]::after,
.md-content a[href*='citeseerx.ist.psu.edu' i]::after,
.md-content a[href*='eprint.iacr.org' i]::after,
/* Textfiles */
.md-content a[href$='.opml' i]::after,
.md-content a[href$='.page' i]::after,
.md-content a[href$='.txt' i]::after,
.md-content a[href$='.xml' i]::after,
/* Code */
.md-content a[href$='.css' i]::after,
.md-content a[href$='.hs' i]::after,
.md-content a[href$='.js' i]::after,
.md-content a[href$='.json' i]::after,
.md-content a[href^="."][href$='.php' i]::after,
.md-content a[href$='.sh' i]::after,
.md-content a[href$='.R' i]::after,
.md-content a[href$='.patch' i]::after,
.md-content a[href$='.diff' i]::after,
/* Word */
.md-content a[href$='.doc' i]::after,
.md-content a[href$='.docx' i]::after,
.md-content a[href*='docs.google.com' i]::after,
/* Excel */
.md-content a[href$='.xls' i]::after,
.md-content a[href$='.xlsx' i]::after,
.md-content a[href$='.ods' i]::after,
/* CSV */
.md-content a[href$='.csv' i]::after,
/* Images */
.md-content a[href$='.gif' i]::after,
.md-content a[href$='.bmp' i]::after,
.md-content a[href$='.ico' i]::after,
.md-content a[href$='.jpg' i]::after,
.md-content a[href$='.jpeg' i]::after,
.md-content a[href$='.png' i]::after,
.md-content a[href$='.svg' i]::after,
.md-content a[href$='.xcf' i]::after,
.md-content a[href*='imgur.com']::after,
/* Audio */
.md-content a[href$='.mp3' i]::after,
.md-content a[href$='.wav' i]::after,
.md-content a[href$='.flac' i]::after,
.md-content a[href$='.ogg' i]::after,
.md-content a[href$='.rm' i]::after,
/* Video */
.md-content a[href$='.swf' i]::after,
.md-content a[href$='.avi' i]::after,
.md-content a[href$='.mp4' i]::after,
.md-content a[href$='.webm' i]::after,
/* Archives */
.md-content a[href$='.tar' i]::after,
.md-content a[href$='.zip' i]::after,
.md-content a[href$='.xz' i]::after,
.md-content a[href$='.img' i]::after,
/* Misc */
.md-content a[href$='.ebt' i]::after,
.md-content a[href$='.mdb' i]::after,
.md-content a[href$='.mht' i]::after,
.md-content a[href$='.ttf' i]::after {
content: "";
display: inline-block;
position: static;
background-repeat: no-repeat;
background-position: bottom center;
height: 0.75em;
width: 0.75em;
margin: 0 0 0 2px;
opacity: 0.55;
}
/* PDFs */
.md-content a[href$='.pdf' i]:hover::after,
.md-content a[href$='/pdf' i]:hover::after,
.md-content a[href$='type=pdf' i]:hover::after,
.md-content a[href*='.pdf#' i]:hover::after,
.md-content a[href$='.epub' i]:hover::after,
.md-content a[href*='pdfs.semanticscholar.org' i]:hover::after,
.md-content a[href*='citeseerx.ist.psu.edu' i]:hover::after,
.md-content a[href*='eprint.iacr.org' i]:hover::after,
/* Textfiles */
.md-content a[href$='.opml' i]:hover::after,
.md-content a[href$='.page' i]:hover::after,
.md-content a[href$='.txt' i]:hover::after,
.md-content a[href$='.xml' i]:hover::after,
/* Code */
.md-content a[href$='.css' i]:hover::after,
.md-content a[href$='.hs' i]:hover::after,
.md-content a[href$='.js' i]:hover::after,
.md-content a[href$='.json' i]:hover::after,
.md-content a[href^="."][href$='.php' i]:hover::after,
.md-content a[href$='.sh' i]:hover::after,
.md-content a[href$='.R' i]:hover::after,
.md-content a[href$='.patch' i]:hover::after,
.md-content a[href$='.diff' i]:hover::after,
/* Word */
.md-content a[href$='.doc' i]:hover::after,
.md-content a[href$='.docx' i]:hover::after,
.md-content a[href*='docs.google.com' i]:hover::after,
/* Excel */
.md-content a[href$='.xls' i]:hover::after,
.md-content a[href$='.xlsx' i]:hover::after,
.md-content a[href$='.ods' i]:hover::after,
/* CSV */
.md-content a[href$='.csv' i]:hover::after,
/* Images */
.md-content a[href$='.gif' i]:hover::after,
.md-content a[href$='.bmp' i]:hover::after,
.md-content a[href$='.ico' i]:hover::after,
.md-content a[href$='.jpg' i]:hover::after,
.md-content a[href$='.jpeg' i]:hover::after,
.md-content a[href*='imgur.com']:hover::After,
.md-content a[href$='.png' i]:hover::after,
.md-content a[href$='.svg' i]:hover::after,
.md-content a[href$='.xcf' i]:hover::after,
/* Audio */
.md-content a[href$='.mp3' i]:hover::after,
.md-content a[href$='.wav' i]:hover::after,
.md-content a[href$='.flac' i]:hover::after,
.md-content a[href$='.ogg' i]:hover::after,
.md-content a[href$='.rm' i]:hover::after,
/* Video */
.md-content a[href$='.swf' i]:hover::after,
.md-content a[href$='.avi' i]:hover::after,
.md-content a[href$='.mp4' i]:hover::after,
.md-content a[href$='.webm' i]:hover::after,
/* Archives */
.md-content a[href$='.tar' i]:hover::after,
.md-content a[href$='.zip' i]:hover::after,
.md-content a[href$='.xz' i]:hover::after,
.md-content a[href$='.img' i]:hover::after,
/* Misc */
.md-content a[href$='.ebt' i]:hover::after,
.md-content a[href$='.mdb' i]:hover::after,
.md-content a[href$='.mht' i]:hover::after,
.md-content a[href$='.ttf' i]:hover::after {
opacity: 0.3;
}
/* PDFs.
*/
.md-content a[href$='.pdf' i]::after,
.md-content a[href$='/pdf' i]::after,
.md-content a[href$='type=pdf' i]::after,
.md-content a[href*='.pdf#' i]::after,
.md-content a[href$='.epub' i]::after,
.md-content a[href*='pdfs.semanticscholar.org' i]::after,
.md-content a[href*='citeseerx.ist.psu.edu' i]::after,
.md-content a[href*='eprint.iacr.org' i]::after {
opacity: 0.5;
/* PDFs are linked on every page, so make another exception */
background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzODQgNTEyIj48cGF0aCBkPSJNMTgxLjkgMjU2LjFjLTUtMTYtNC45LTQ2LjktMi00Ni45IDguNCAwIDcuNiAzNi45IDIgNDYuOXptLTEuNyA0Ny4yYy03LjcgMjAuMi0xNy4zIDQzLjMtMjguNCA2Mi43IDE4LjMtNyAzOS0xNy4yIDYyLjktMjEuOS0xMi43LTkuNi0yNC45LTIzLjQtMzQuNS00MC44ek04Ni4xIDQyOC4xYzAgLjggMTMuMi01LjQgMzQuOS00MC4yLTYuNyA2LjMtMjkuMSAyNC41LTM0LjkgNDAuMnpNMjQ4IDE2MGgxMzZ2MzI4YzAgMTMuMy0xMC43IDI0LTI0IDI0SDI0Yy0xMy4zIDAtMjQtMTAuNy0yNC0yNFYyNEMwIDEwLjcgMTAuNyAwIDI0IDBoMjAwdjEzNmMwIDEzLjIgMTAuOCAyNCAyNCAyNHptLTggMTcxLjhjLTIwLTEyLjItMzMuMy0yOS00Mi43LTUzLjggNC41LTE4LjUgMTEuNi00Ni42IDYuMi02NC4yLTQuNy0yOS40LTQyLjQtMjYuNS00Ny44LTYuOC01IDE4LjMtLjQgNDQuMSA4LjEgNzctMTEuNiAyNy42LTI4LjcgNjQuNi00MC44IDg1LjgtLjEgMC0uMS4xLS4yLjEtMjcuMSAxMy45LTczLjYgNDQuNS01NC41IDY4IDUuNiA2LjkgMTYgMTAgMjEuNSAxMCAxNy45IDAgMzUuNy0xOCA2MS4xLTYxLjggMjUuOC04LjUgNTQuMS0xOS4xIDc5LTIzLjIgMjEuNyAxMS44IDQ3LjEgMTkuNSA2NCAxOS41IDI5LjIgMCAzMS4yLTMyIDE5LjctNDMuNC0xMy45LTEzLjYtNTQuMy05LjctNzMuNi03LjJ6TTM3NyAxMDVMMjc5IDdjLTQuNS00LjUtMTAuNi03LTE3LTdoLTZ2MTI4aDEyOHYtNi4xYzAtNi4zLTIuNS0xMi40LTctMTYuOXptLTc0LjEgMjU1LjNjNC4xLTIuNy0yLjUtMTEuOS00Mi44LTkgMzcuMSAxNS44IDQyLjggOSA0Mi44IDl6Ii8+PC9zdmc+');
}
/* Textfiles.
*/
.md-content a[href$='.opml' i]::after,
.md-content a[href$='.page' i]::after,
.md-content a[href$='.txt' i]::after,
.md-content a[href$='.xml' i]::after {
background-image: url('/autoimport/assets/images/txt.svg');
}
/* Code, scripts, etc.
*/
.md-content a[href$='.css' i]::after,
.md-content a[href$='.hs' i]::after,
.md-content a[href$='.js' i]::after,
.md-content a[href$='.json' i]::after,
.md-content a[href$='.R' i]::after,
.md-content a[href$='.diff' i]::after,
.md-content a[href$='.patch' i]::after,
.md-content a[href^="."][href$='.php' i]::after,
.md-content a[href$='.sh' i]::after {
background-image: url('/autoimport/assets/images/code.svg');
}
/* Word (& compatible) documents.
*/
.md-content a[href$='.doc' i]::after,
.md-content a[href$='.docx' i]::after,
.md-content a[href*='docs.google.com' i]::after {
background-image: url('/autoimport/assets/images/worddoc.svg');
}
/* Excel (& compatible) documents.
*/
.md-content a[href$='.xls' i]::after,
.md-content a[href$='.ods' i]::after,
.md-content a[href$='.xlsx' i]::after {
background-image: url('/autoimport/assets/images/spreadsheet.svg');
}
/* CSV files.
*/
.md-content a[href$='.csv' i]::after {
background-image: url('/autoimport/assets/images/csv.svg');
}
/* Images.
*/
.md-content a[href$='.gif' i]::after,
.md-content a[href$='.bmp' i]::after,
.md-content a[href$='.ico' i]::after,
.md-content a[href$='.jpg' i]::after,
.md-content a[href$='.jpeg' i]::after,
.md-content a[href$='.png' i]::after,
.md-content a[href$='.svg' i]::after,
.md-content a[href$='.xcf' i]::after,
.md-content a[href*='imgur.com']::after {
background-image: url('/autoimport/assets/images/image.svg');
}
/* Audio files.
*/
.md-content a[href$='.mp3' i]::after,
.md-content a[href$='.wav' i]::after,
.md-content a[href$='.flac' i]::after,
.md-content a[href$='.rm' i]::after,
.md-content a[href$='.ogg' i]::after {
background-image: url('/autoimport/assets/images/audio.svg');
}
/* Video files.
*/
.md-content a[href$='.swf' i]::after,
.md-content a[href$='.avi' i]::after,
.md-content a[href$='.mp4' i]::after,
.md-content a[href$='.webm' i]::after {
background-image: url('/autoimport/assets/images/video.svg');
}
/* Archive files.
*/
.md-content a[href$='.tar' i]::after,
.md-content a[href$='.zip' i]::after,
.md-content a[href$='.xz' i]::after,
.md-content a[href$='.img' i]::after {
background-image: url('/autoimport/assets/images/archive.svg');
}
/* Miscellaneous files (for which there is no specific icon).
*/
.md-content a[href$='.ebt' i]::after,
.md-content a[href$='.mdb' i]::after,
.md-content a[href$='.mht' i]::after,
.md-content a[href$='.ttf' i]::after {
background-image: url('/autoimport/assets/images/misc.svg');
}
autoimport-1.6.0/docs/theme/ 0000775 0000000 0000000 00000000000 14644010763 0015760 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/theme/assets/ 0000775 0000000 0000000 00000000000 14644010763 0017262 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/theme/assets/images/ 0000775 0000000 0000000 00000000000 14644010763 0020527 5 ustar 00root root 0000000 0000000 autoimport-1.6.0/docs/theme/assets/images/amazon.svg 0000664 0000000 0000000 00000001370 14644010763 0022536 0 ustar 00root root 0000000 0000000
autoimport-1.6.0/docs/theme/assets/images/archive.svg 0000664 0000000 0000000 00000001163 14644010763 0022672 0 ustar 00root root 0000000 0000000
autoimport-1.6.0/docs/theme/assets/images/audio.svg 0000664 0000000 0000000 00000001256 14644010763 0022355 0 ustar 00root root 0000000 0000000
autoimport-1.6.0/docs/theme/assets/images/bluebook.2.svg 0000664 0000000 0000000 00000057353 14644010763 0023227 0 ustar 00root root 0000000 0000000
autoimport-1.6.0/docs/theme/assets/images/bluebook.bmp 0000664 0000000 0000000 00004000212 14644010763 0023030 0 ustar 00root root 0000000 0000000 BMŠ Š | ×
×
ÿ ÿ ÿ ÿBGRs
Ð Ð Ð Ð Ð Ð Ð Ð Ã E
õ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ «
H Û ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ õ y
¬ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Ù G
u ô ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ
> Ô ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ õ {
¢ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ Ú H
j ï ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ÿ ¯
<