Jelajahi Sumber

Merge branch 'master' of github.com:takluyver/pynsist

Nicholas H.Tollervey 7 tahun lalu
induk
melakukan
6e78c65075
8 mengubah file dengan 58 tambahan dan 37 penghapusan
  1. 3 0
      doc/conf.py
  2. 10 9
      doc/installers.rst
  3. 1 0
      doc/pypi-requirements.txt
  4. 8 0
      doc/releasenotes.rst
  5. 1 1
      examples/console/installer.cfg
  6. 0 24
      flit.ini
  7. 3 3
      nsist/__init__.py
  8. 32 0
      pyproject.toml

+ 3 - 0
doc/conf.py

@@ -37,8 +37,11 @@ extensions = [
     'sphinx.ext.autodoc',
     'sphinx.ext.autodoc',
     'sphinx.ext.intersphinx',
     'sphinx.ext.intersphinx',
     'sphinx.ext.viewcode',
     'sphinx.ext.viewcode',
+    'sphinxcontrib_github_alt',
 ]
 ]
 
 
+github_project_url = "https://github.com/takluyver/pynsist"
+
 # Add any paths that contain templates here, relative to this directory.
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 templates_path = ['_templates']
 
 

+ 10 - 9
doc/installers.rst

@@ -3,24 +3,25 @@ Installer details
 
 
 The installers pynsist builds do a number of things:
 The installers pynsist builds do a number of things:
 
 
-1. Unpack and run the Python .msi installer for the version of Python you
-   specified.
-2. Unpack and run the .msi installer for the `py launcher
-   <https://bitbucket.org/vinay.sajip/pylauncher>`_, if you're using Python 2
-   (in Python 3, this is installed as part of Python).
-3. Install a number of files in the installation directory the user selects:
+1. Install a number of files in the installation directory the user selects:
 
 
+   - An embedded build of Python, including the standard library.
+   - A copy of the necessary Microsoft C runtime for Python to run, if this
+     is not already installed on the system.
    - The launcher script(s) that start your application
    - The launcher script(s) that start your application
    - The icon(s) for your application launchers
    - The icon(s) for your application launchers
    - Python packages your application needs
    - Python packages your application needs
    - Any other files you specified
    - Any other files you specified
 
 
-4. Create a start menu shortcut for each launcher script. If there is only one
+2. Create a start menu shortcut for each launcher script. If there is only one
    launcher, it will go in the top level of the start menu. If there's more than
    launcher, it will go in the top level of the start menu. If there's more than
    one, the installer will make a folder named after the application.
    one, the installer will make a folder named after the application.
+3. If you have specified any :ref:`commands <command_config>`, modify the
+   :envvar:`PATH` environment variable in the registry, so that your commands
+   will be available in a system command prompt.
+4. Byte-compile all Python files in the ``pkgs`` subdirectory. This should
+   slightly improve the startup time of your application.
 5. Write an uninstaller, and the registry keys to put it in 'Add/remove programs'.
 5. Write an uninstaller, and the registry keys to put it in 'Add/remove programs'.
-   The uninstaller only uninstalls your application (undoing steps 3-5); it
-   leaves Python alone, because there might be other applications using Python.
 
 
 The installer (and uninstaller) is produced using `NSIS
 The installer (and uninstaller) is produced using `NSIS
 <http://nsis.sourceforge.net/Main_Page>`_, with the Modern UI.
 <http://nsis.sourceforge.net/Main_Page>`_, with the Modern UI.

+ 1 - 0
doc/pypi-requirements.txt

@@ -3,3 +3,4 @@ requests
 win_cli_launchers
 win_cli_launchers
 yarg
 yarg
 requests_download
 requests_download
+sphinxcontrib_github_alt

+ 8 - 0
doc/releasenotes.rst

@@ -1,6 +1,14 @@
 Release notes
 Release notes
 =============
 =============
 
 
+Version 2.1
+-----------
+
+* Fix for launching Python subprocesses with the installed packages available
+  for import (:ghpull:`142`).
+* Ensure ``.pth`` files in the installed packages directory are read
+  (:ghpull:`138`).
+
 Version 2.0
 Version 2.0
 -----------
 -----------
 
 

+ 1 - 1
examples/console/installer.cfg

@@ -6,7 +6,7 @@ entry_point=guessnumber:main
 console=true
 console=true
 
 
 [Python]
 [Python]
-version=3.5.1
+version=3.6.3
 bitness=64
 bitness=64
 format=bundled
 format=bundled
 
 

+ 0 - 24
flit.ini

@@ -1,24 +0,0 @@
-[metadata]
-module = nsist
-author = Thomas Kluyver
-author-email = thomas@kluyver.me.uk
-dist-name = pynsist
-home-page = https://pynsist.readthedocs.io/en/latest/
-description-file = README.rst
-requires-python = >=3.5
-requires = requests
-    requests_download
-    jinja2
-    yarg
-    win_cli_launchers
-dev-requires = testpath
-classifiers = License :: OSI Approved :: MIT License
-    Intended Audience :: Developers
-    Environment :: Win32 (MS Windows)
-    Programming Language :: Python :: 3
-    Topic :: Software Development
-    Topic :: System :: Installation/Setup
-    Topic :: System :: Software Distribution
-
-[scripts]
-pynsist=nsist:main

+ 3 - 3
nsist/__init__.py

@@ -26,7 +26,7 @@ from .nsiswriter import NSISFileWriter
 from .pypi import fetch_pypi_wheels
 from .pypi import fetch_pypi_wheels
 from .util import download, text_types, get_cache_dir
 from .util import download, text_types, get_cache_dir
 
 
-__version__ = '2.0'
+__version__ = '2.1'
 
 
 pjoin = os.path.join
 pjoin = os.path.join
 logger = logging.getLogger(__name__)
 logger = logging.getLogger(__name__)
@@ -180,7 +180,7 @@ class InstallerBuilder(object):
 
 
         It will be unpacked into the build directory.
         It will be unpacked into the build directory.
 
 
-        In addition, any *._pth files found therein will have the pkgs path
+        In addition, any ``*._pth`` files found therein will have the pkgs path
         appended to them.
         appended to them.
         """
         """
         url, filename = self._python_download_url_filename()
         url, filename = self._python_download_url_filename()
@@ -208,7 +208,7 @@ class InstallerBuilder(object):
                      and f.endswith('._pth')]
                      and f.endswith('._pth')]
         for pth in pth_files:
         for pth in pth_files:
             with open(pjoin(python_dir, pth), 'a+b') as f:
             with open(pjoin(python_dir, pth), 'a+b') as f:
-                f.write(b'\r\n..\\pkgs\r\n')
+                f.write(b'\r\n..\\pkgs\r\nimport site\r\n')
 
 
         self.install_dirs.append(('Python', '$INSTDIR'))
         self.install_dirs.append(('Python', '$INSTDIR'))
 
 

+ 32 - 0
pyproject.toml

@@ -0,0 +1,32 @@
+[build-system]
+requires = ["flit"]
+build-backend = "flit.buildapi"
+
+[tool.flit.metadata]
+module = "nsist"
+author = "Thomas Kluyver"
+author-email = "thomas@kluyver.me.uk"
+dist-name = "pynsist"
+home-page = "https://pynsist.readthedocs.io/en/latest/"
+description-file = "README.rst"
+requires-python = ">=3.5"
+requires = [
+    "requests",
+    "requests_download",
+    "jinja2",
+    "yarg",
+    "win_cli_launchers"
+]
+dev-requires = ["testpath"]
+classifiers = [
+    "License :: OSI Approved :: MIT License",
+    "Intended Audience :: Developers",
+    "Environment :: Win32 (MS Windows)",
+    "Programming Language :: Python :: 3",
+    "Topic :: Software Development",
+    "Topic :: System :: Installation/Setup",
+    "Topic :: System :: Software Distribution",
+]
+
+[tool.flit.scripts]
+pynsist = "nsist:main"