Makefile a klasifikátory

Developing Python Packages

James Fulton

Climate informatics researcher

Klasifikátory

  • Metadata balíčku
  • Pomáhají uživatelům najít váš balíček na PyPI
  • Doporučené položky
    • Stav balíčku
    • Cílová skupina
    • Typ licence
    • Jazyk
    • Podporované verze Pythonu
  • Další klasifikátory: https://pypi.org/classifiers

Obsah setup.py balíčku mysklearn

setup(
    ...
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Natural Language :: English',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
    ],
    ...
)
Developing Python Packages

K čemu slouží Makefile?

  • Automatizuje části procesu sestavení balíčku
mysklearn/
...
|-- README.md
|-- setup.py
|-- Makefile  <---
...
Developing Python Packages

Co obsahuje Makefile?

Obsah Makefile

...

dist: ## builds source and wheel package
    python3 setup.py sdist bdist_wheel

clean-build: ## remove build artifacts rm -fr build/ rm -fr dist/ rm -fr .eggs/
test: ## run tests quickly with the default Python pytest
release: dist ## package and upload a release twine upload dist/*
Developing Python Packages

Jak se používá Makefile?

make <function-name>
mysklearn/ <--- přejděte sem
...
|-- README.md
|-- setup.py
|-- Makefile  
...
Developing Python Packages

Jak se používá Makefile?

Funkci dist spustíte v terminálu příkazem

make dist

Obsah Makefile

...

dist: ## builds source and wheel package
    python3 setup.py sdist bdist_wheel

clean-build: ## remove build artifacts
    rm -fr build/
    rm -fr dist/
    rm -fr .eggs/

test: ## run tests quickly with the default Python
    pytest

release: dist ## package and upload a release
    twine upload dist/*
Developing Python Packages

Přehled Makefile

make help
clean                remove all build, test, coverage and Python artifacts
clean-build          remove build artifacts
clean-pyc            remove Python file artifacts
clean-test           remove test and coverage artifacts
lint                 check style with flake8
test                 run tests quickly with the default Python
test-all             run tests on every Python version with tox
release              package and upload a release
dist                 builds source and wheel package
install              install the package to the active Python's site-packages
Developing Python Packages

Pojďme si procvičit!

Developing Python Packages

Preparing Video For Download...