1. 12 Oct, 2021 10 commits
  2. 15 Apr, 2020 2 commits
  3. 08 Apr, 2020 1 commit
  4. 07 Apr, 2020 2 commits
    • Peter Grayson's avatar
      Update release_process.rst for 4.0 · 47b13244
      Peter Grayson authored
      Document contemporary release process using GitLab CI pipeline where the
      pipeline uploads to PyPI after successful build of a tag.
      Also many minor corrections and url updates.
    • Peter Grayson's avatar
      Prepare history.rst for 4.0 release · e4ac2d54
      Peter Grayson authored
      Include the top-level CHANGES.rst in history.rst instead of duplicating the
      changelog entries in both places.
      The section headings in the remainder of history.rst are fixed-up so that
      the pre-3.0 historical change information fits with the included
      Also reflow the long lines and generally touch-up the formatting of
  5. 06 Apr, 2020 3 commits
  6. 05 Apr, 2020 16 commits
    • Peter Grayson's avatar
      Add tool.setuptools_scm section to pyproject.toml · dccbc991
      Peter Grayson authored
      This is needed to enable setuptools_scm when not building with setup.py
    • Peter Grayson's avatar
      Build system updates for PEP-517/518 · 44499872
      Peter Grayson authored
      The distribution metadata is migrated from setup.py to setup.cfg. setup.py
      is now just a stub. Note that `python setup.py ...` commands still work.
      A pyproject.toml file is added. It contains the PEP-517/518 specified
      build-system section which describes SimPy's build-time dependencies along
      with which build backend SimPy uses (which is still setuptools).
      And tox is now configured with isolated_build = True, which causes tox to
      make the source dist in a sandbox instead of relying on the host
      environment. This helps ensure that the distribution build will work with
      just the tooling specified in pyproject.toml.
    • Peter Grayson's avatar
      Add mypy to tox envlist · ae2dd1c8
      Peter Grayson authored
      The mypy testenv already exists, it just wasn't in the list of environments
      to build by default.
    • Peter Grayson's avatar
      Event._value class attribute · f32d733b
      Peter Grayson authored
      This improves the runtime performance of Event and Process by decreasing
      the initializer cost.
      Adding the Event._value class attribute allows Event.__init__() to elide
      initialization of the self._value instance attribute. For Event and
      Process events, the event value is only assigned later in the event's
      lifecycle. When self._value is eventually assigned, it creates an instance
      attribute that shadows the static Event._value class attribute. This works
      well for events because accesses to the Event._value class attribute are
    • Peter Grayson's avatar
      Sphinx use type checking stubs of BoundClass methods · 2d0b513b
      Peter Grayson authored
      The documentation for Environment's BoundClass methods (process(),
      timeout(), event(), etc.) is moved from simpy.core.rst to core.py. The
      docstrings are now associated with the TYPE_CHECKING-only stubs and Sphinx
      now documents using those stubs.
      Other classes with BoundClass methods are now also documented using the
      type checking stubs. The generated API docs thus now show a proper method
      signature instead of treating the BoundClass methods as data attributes of
      the class.
    • Peter Grayson's avatar
      Add inline type annotations · 3d24f462
      Peter Grayson authored
      The primary goal for these annotations is to be helpful documentation for
      users of the SimPy API. To this end, type annotations are added to each
      SimPy method, function, and global. Also, by testing the value of
      typing.TYPE_CHECKING at import time, the final, effective types for methods
      bound with BoundClass magic can be expressed directly.
      A secondary goal is to allow static checking for type soundness issues
      using mypy. Mypy is added to requirements-dev.txt along with basic
      configuration in setup.cfg. A few `# type: ignore` directives were needed
      to deal with some of SimPy's internal optimizations, but with those in
      place, SimPy type checks cleanly with mypy.
      Special care was taken to avoid any performance regressions. Notably, a few
      classes that might be expressed as generic using typing.Generic (e.g.
      Event) were made non-generic to avoid the small-but-measurable performance
      impact of instantiating a class that derives from Generic. Also, in a few
      places we opted for using...
    • Peter Grayson's avatar
      Add SimPy 3 to 4 porting guide to docs · 41cd293e
      Peter Grayson authored
      This porting guide covers the minor breaking changes between SimPy 3 and 4.
    • Peter Grayson's avatar
      Remove BaseEnvironment · addba53e
      Peter Grayson authored
      The Environment class is a sufficient base for user-defined Environment
      subclasses. Removing BaseEnvironment reduces the amount of user-facing
      documentation along with being one less thing in the code to maintain.
      N.B. RealtimeEnvironment already inherited from Environment, not
    • Peter Grayson's avatar
      Use f-strings throughout code · 5a5cb077
      Peter Grayson authored
      Python 3.6+ supports f-strings. These are generally faster and more
      ergonomic than the alternatives of either old-style interpolation,
      str.format(), or concatenation with `+`.
    • Peter Grayson's avatar
      Remove Environment.exit() method · 2ff3d556
      Peter Grayson authored
      This method was needed for Python2 code where it was otherwise illegal to
      `return` from a generator. Since Python3 supports `return` in generators,
      the `exit()` method is unneeded. And since calling `env.exit()` is less
      ergonomic than simply using `return`, there is no reason to keep it.
      As an illustration, this generator written in Python2 style:
          def proc(env):
              yield env.timeout(1)
      can be expressed in Python3 as:
          def proc(env):
              yield env.timeout(1)
              return 42
    • Peter Grayson's avatar
      Remove support for Python 2.x · 43c8b4fd
      Peter Grayson authored
      Python2 compatibility code is removed.
      - Do not explicitly inherit from `object`.
      - Use `super().__init__(...)` instead of `super(Self, self).__init__`.
      - Entirely remove compat.py.
      - Remove Python2 versions of example simulation output (.out2 files).
      - Use Python3 imports exclusively.
      Documentation and build are also updated to reflect these changes.
      Addresses #92.
    • Peter Grayson's avatar
      Update changelog for 3.0.13 release · 2a25837a
      Peter Grayson authored
    • Peter Grayson's avatar
      Add deploy stage to CI to upload to PyPI · a05a3499
      Peter Grayson authored
      The new deploy stage is limited to only running when the reference the
      pipeline is running against is a tag.
      A new twine-check job is added to the test stage. It checks the built
      distribution files using `twine check`.
      The twine upload command depends on the TWINE_USERNAME and TWINE_PASSWORD
      environment variables being set by the CI runner. The username and password
      should be a PyPI API token.
    • Peter Grayson's avatar
      Minor CI cleanups · e9242ab3
      Peter Grayson authored
      Invoke pip via `python -m pip` as a best practice.
      Remove some unnecessary quoting in tox commands.
    • Peter Grayson's avatar
      Rename wheel to bdist_wheel in setup.cfg · 80d112d9
      Peter Grayson authored
      The "wheel" section name is deprecated. Rename to the new name,
    • Peter Grayson's avatar
      Add long_description_content_type to setup · f96f2194
      Peter Grayson authored
      The value 'text/x-rst' (restructuredtext) is the default, so this is added
      in the name of completeness.
  7. 29 Mar, 2020 2 commits
    • Peter Grayson's avatar
      Use setuptools_scm · 43dba66c
      Peter Grayson authored
      setuptools_scm extends setuptools to use git metadata to help build python
      packages. It specifically helps to:
      - Dynamically determine the simpy version based on tag, commit distance
        from nearest tag, and workspace dirtiness.
      - Determine which files to include in the distribution based on git, thus
        MANIFEST.in is obviated.
      Using setuptools_scm solves the problem of build artifacts being
      mis-versioned with the last release version. This problem affects both
      local builds and, perhaps more importantly, continuous integration
      Another problem this solves is that the tests directory is now included in
      the source distribution, whereas it was missing from MANIFEST.in.
      The simpy.__version__ value is looked-up dynamically using
    • Peter Grayson's avatar
      Repair missing variable in Process._resume() · 69e3396d
      Peter Grayson authored
      An error handler path in Process._resume() was exposed to using an
      undefined local variable. In practice, this path was difficult to hit.
      The repair is to re-raise if it is not the expected AttributeError.
  8. 28 Mar, 2020 2 commits
    • Peter Grayson's avatar
      Ignore .eggs and .benchmarks · 8c7ee9a8
      Peter Grayson authored
      The .benchmarks directory contains benchmark data when running `pytest -m
      The .eggs directory contains build-time dependencies, such as
      setuptools_scm and wheel, if they are not otherwise available in the python
      execution environment.
    • Peter Grayson's avatar
      Remove .hgtags file · d3e270e7
      Peter Grayson authored
  9. 23 Mar, 2020 2 commits