File: //usr/lib/python3/dist-packages/twisted/python/test/__pycache__/test_release.cpython-38.pyc
U
W[V� � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl
Z
ddlmZm
Z
ddlmZmZmZ ddlmZ ddlmZ ddlmZ dd lmZ dd
lmZ ddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) ej*dkr�d
Z+ndZ+dZ,zddl-Z.W n e/e0fk
�r. dZ1Y nX e2e.dd�dk �rHdZ1ne+Z1e+�sbed��rbdZ3ndZ3e+�s�ed��r�e$ddg��4d�d �4d�Z5e6e5d �dk�r�e+Z7ndZ7ndZ7G dd� de�Z8dd � Z9d!d"� Z:d#d$� Z;G d%d&� d&e<�Z=G d'd(� d(e8�Z>G d)d*� d*e8�Z?d+d,� Z@G d-d.� d.e�ZAG d/d0� d0e8�ZBG d1d2� d2e�ZCG d3d4� d4e�ZDG d5d6� d6e=�ZEG d7d8� d8eEe8�ZFG d9d:� d:e8�ZGG d;d<� d<e�ZHG d=d>� d>e8�ZIdS )?z�
Tests for L{twisted.python.release} and L{twisted.python._release}.
All of these tests are skipped on platforms other than Linux, as the release is
only ever performed on Linux.
� )�print_functionN)�BytesIO�StringIO)�TestCase�FailTest�SkipTest)�which)�release)�FilePath)�Version)�CalledProcessError)
�findTwistedProjects�
replaceInFile�Project�
filePathDelta�
APIBuilder�BuildAPIDocsScript�CheckNewsfragmentScript�
runCommand�NotWorkingDirectory�
SphinxBuilder�
GitCommand�getRepositoryCommand�IVCSCommand�posixz*Release toolchain only supported on POSIX.zmaster_doc = 'index'
zPydoctor is not present.�version_info�r )r � zPydoctor is too old.zsphinx-buildzSphinx not available.�gitz --version� � � .zold git is presentzgit is not present.c @ s e Zd ZdZdd� ZdS )�ExternalTempdirTestCasez�
A test case which has mkdir make directories outside of the usual spot, so
that Git commands don't interfere with the Twisted checkout.
c C s t jdd�}| �tj|� |S )z)
Make our own directory.
z/tmp/)�dir)�tempfileZmkdtempZ
addCleanup�shutilZrmtree)�selfZnewDir� r'