Skip to content

Commit

Permalink
Lots of mixed fixes
Browse files Browse the repository at this point in the history
Update to menpo 0.12.0
Remove widgets
Update to circleci
Update to miniver
  • Loading branch information
patricksnape committed Jan 14, 2021
1 parent eadf374 commit f5e2886
Show file tree
Hide file tree
Showing 21 changed files with 2,707 additions and 4,351 deletions.
58 changes: 58 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
version: 2

workflows:
version: 2
test:
jobs:
- linux_python_3.6:
context:
- menpo
- linux_python_3.7:
context:
- menpo
- linux_python_3.8:
context:
- menpo
- linux_python_3.9:
filters:
tags:
only: /.*/
context:
- menpo

template: &linux_template
docker:
- image: circleci/python:latest
steps:
- checkout
- run:
name: Setup Miniconda
command: |
wget https://raw.githubusercontent.com/menpo/condaci/circleci/condaci.py -O condaci.py
python condaci.py setup --channels conda-forge
- run:
name: Run conda build
command: |
~/miniconda/bin/python condaci.py build ./conda
jobs:
linux_python_3.6:
<<: *linux_template
environment:
CONDACI_PYPI_SDIST_UPLOAD_PY_VER: 3.9
PYTHON_VERSION: 3.6
linux_python_3.7:
<<: *linux_template
environment:
CONDACI_PYPI_SDIST_UPLOAD_PY_VER: 3.9
PYTHON_VERSION: 3.7
linux_python_3.8:
<<: *linux_template
environment:
CONDACI_PYPI_SDIST_UPLOAD_PY_VER: 3.9
PYTHON_VERSION: 3.8
linux_python_3.9:
<<: *linux_template
environment:
CONDACI_PYPI_SDIST_UPLOAD_PY_VER: 3.9
PYTHON_VERSION: 3.9
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include versioneer.py
include menpofit/_version.py
include LICENSE.txt
include AUTHORS.txt
3 changes: 3 additions & 0 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy:
- 1.16 # [not osx]
- 1.19 # [osx]
12 changes: 5 additions & 7 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ requirements:

run:
- python
- menpo>=0.9.0,<0.11.0
- menpo>=0.9.0,<0.12.0
- scikit-learn>=0.16
- pandas>=0.24

test:
requires:
- pytest >=5.0,<6.0
- pytest >=6.0,<7.0
- pytest-cov >=2.0,<3.0
- mock >=3.0,<4.0
- pytest-mock >=3.0,<4.0

files:
- .coveragerc
Expand All @@ -33,10 +33,8 @@ test:
- menpo

commands:
- MPLBACKEND=Agg pytest $SP_DIR/menpofit -v --cov=menpofit --cov-config .coveragerc # [linux]
- MPLBACKEND=TKAgg pytest $SP_DIR/menpofit -v --cov=menpofit --cov-config .coveragerc # [osx]
- pytest %SP_DIR%\\menpofit -v --cov=menpofit --cov-config .coveragerc --junitxml=C:\\menpofit.xml # [win]

- MPLBACKEND=Agg pytest $SP_DIR/menpofit -v --cov=menpofit --cov-config .coveragerc # [linux]
- MPLBACKEND=TKAgg pytest $SP_DIR/menpofit -v --cov=menpofit --cov-config .coveragerc # [osx]

about:
home: https://github.com/menpo/menpofit/
Expand Down
6 changes: 3 additions & 3 deletions docs/rtd_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies:

# Note that dlib and sklearn are mocked otherwise readthedocs runs out of
# memory setting up the environment
- menpo >=0.9,<0.11
- menpo >=0.9,<0.12
- sphinx >=2,<3
- sphinx_rtd_theme
- pip:
- sphinx >=2,<3
- sphinx_rtd_theme
- sphinxmapxrefrole >=0.2
87 changes: 46 additions & 41 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,56 @@

# on_rtd is whether we are on readthedocs.org,
# this line of code grabbed from docs.readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

# Add the folder above so we can grab the sphinx extensions
sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

if not on_rtd:
# Add the menpofit root so we can grab the version
sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath("../../"))
else:
from mock import MagicMock
from unittest.mock import MagicMock

MOCK_MODULES = ['dlib', 'sklearn']
MOCK_MODULES = ["dlib", "sklearn"]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = MagicMock()

import menpofit

# add an up to date mathjax path
mathjax_path = 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
mathjax_path = (
"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
)

# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '2.0'
needs_sphinx = "2.0"

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinxext.ref_prettify',
'sphinxext.theme_hack',
'sphinxmapxrefrole']
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinxext.ref_prettify",
"sphinxext.theme_hack",
"sphinxmapxrefrole",
]

# Import the mapping dictionary and set it for sphinxmapxrefrole
from xref_map import xref_map

xref_mapping_dict = xref_map

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
html_static_path = ['_static']
templates_path = ["_templates"]
html_static_path = ["_static"]

# Otherwise Sphinx emits thousands of warnings
napoleon_include_special_with_doc = False
Expand All @@ -67,16 +71,18 @@
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# Sort attributes by type (functions separate from properties)
autodoc_member_order = 'groupwise'
autodoc_member_order = "groupwise"

# General information about the project.
project = u'MenpoFit'
authors = (u'Joan Alabort-i-Medina, Epameinondas Antonakos, James Booth,'
u' Patrick Snape, and Stefanos Zafeiriou')
copyright = u'2016, ' + authors
project = u"MenpoFit"
authors = (
u"Joan Alabort-i-Medina, Epameinondas Antonakos, James Booth,"
u" Patrick Snape, and Stefanos Zafeiriou"
)
copyright = u"2016, " + authors

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -99,7 +105,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build', '**/test/**']
exclude_patterns = ["_build", "**/test/**"]

# The reST default role (used for this markup: `text`) to use for all documents.
# default_role = None
Expand Down Expand Up @@ -132,7 +138,7 @@
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme

html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Theme options are theme-specific and customize the look and feel of a theme
Expand Down Expand Up @@ -206,7 +212,7 @@
# html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'MenpoFitdoc'
htmlhelp_basename = "MenpoFitdoc"

# -- Options for LaTeX output --------------------------------------------------

Expand All @@ -217,19 +223,16 @@
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
'preamble': latex_preamble
"preamble": latex_preamble
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'MenpoFit.tex', u'MenpoFit Documentation',
authors, 'manual'),
("index", "MenpoFit.tex", u"MenpoFit Documentation", authors, "manual"),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -257,10 +260,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'menpofit', u'MenpoFit Documentation',
[authors], 1)
]
man_pages = [("index", "menpofit", u"MenpoFit Documentation", [authors], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -272,10 +272,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'MenpoFit', u'MenpoFit Documentation',
authors,
'MenpoFit', 'Python framework for fitting and training deformable models.',
'Miscellaneous'),
(
"index",
"MenpoFit",
u"MenpoFit Documentation",
authors,
"MenpoFit",
"Python framework for fitting and training deformable models.",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand Down
5 changes: 1 addition & 4 deletions menpofit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,4 @@
from . import visualize


from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

from ._version import __version__
12 changes: 12 additions & 0 deletions menpofit/_static_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
# This file is part of 'miniver': https://github.com/jbweston/miniver
#
# This file will be overwritten by setup.py when a source or binary
# distribution is made. The magic value "__use_git__" is interpreted by
# version.py.

version = "__use_git__"

# These values are only set if the distribution was created with 'git archive'
refnames = "$Format:%D$"
git_hash = "$Format:%h$"

0 comments on commit f5e2886

Please sign in to comment.