Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change packaging toolkit to use setuptools-scm #1895

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref-names: $Format:%D$
202 changes: 202 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
# Force LF line endings for text files
* text=auto eol=lf

## SOURCE CODE
*.bat text eol=crlf
*.coffee text
*.css text
*.htm text diff=html
*.html text diff=html
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.od text
*.onlydata text
*.php text diff=php
*.pl text
*.pxd text diff=python
*.py text diff=python
*.py3 text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.rb text diff=ruby
*.sass text
*.scm text
*.scss text
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.vue text
*.xml text
*.xhtml text diff=html

## DOCKER
*.dockerignore text
Dockerfile text

## DOCUMENTATION
*.ipynb text
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text

## TEMPLATES
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl text
*.twig text

## LINTERS
.csslintrc text
.eslintrc text
.htmlhintrc text
.jscsrc text
.jshintrc text
.jshintignore text
.stylelintrc text

## CONFIGS
*.bowerrc text
*.cnf text
*.conf text
*.config text
.babelrc text
.browserslistrc text
.editorconfig text
.env text
.gitattributes text
.gitconfig text
.htaccess text
*.lock text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text

## HEROKU
Procfile text
.slugignore text

## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary

## AUDIO
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary

## VIDEO
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary

## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary

## FONTS
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary

## EXECUTABLES
*.exe binary
*.pyc binary

# Binary files
# ============
*.db binary
*.p binary
*.pkl binary
*.pyd binary
*.pyo binary

# Note: .db, .p, and .pkl files are associated
# with the python modules ``pickle``, ``dbm.*``,
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
# (among others).

# Needed for setuptools-scm-git-archive:
.git_archival.txt export-subst
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,9 @@ jobs:
name: Publishing current Git tagged version of dist to PyPI
if: repo == "ansible/molecule" AND tag IS present
env:
TOXENV: metadata-validation
TOXENV: metadata-validation,build-dists
before_deploy:
- echo > setup.py
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR: deployment provider calls setup.py no matter what, but we build things manually so I'm wiping its contents and it will not affect pre-created dists this way but will still use twine to upload things to PyPI :)

(also a battle-tested hack)

deploy: &deploy-step
provider: pypi
user: ansible-molecule
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

2 changes: 0 additions & 2 deletions lint-requirements.txt

This file was deleted.

12 changes: 9 additions & 3 deletions molecule/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright (c) 2019 Red Hat, Inc.
# Copyright (c) 2015-2018 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -17,8 +18,13 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
"""Molecule version information."""

import pbr.version
from __future__ import absolute_import, division, print_function
webknjaz marked this conversation as resolved.
Show resolved Hide resolved
__metaclass__ = type

version_info = pbr.version.VersionInfo('molecule') # noqa
__version__ = version_info.release_string()
try:
import pkg_resources
__version__ = pkg_resources.get_distribution('molecule').version
except Exception:
__version__ = 'unknown'
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build-system]
requires = [
"setuptools >= 41.0.0",
"setuptools_scm >= 1.15.0",
"setuptools_scm_git_archive >= 1.0",
"wheel",
]
build-backend = "setuptools.build_meta"
20 changes: 0 additions & 20 deletions requirements.txt

This file was deleted.

Loading