diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..41e3295 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Continuous Integration + +on: + pull_request: + merge_group: + +jobs: + launch-unit-tests: + runs-on: ubuntu-latest + + strategy: + matrix: + # Tracked via issue #77 + # 3.6: Not available on ubuntu-22.04 + # 3.7: Results in failures in `test_cli.py` + # 3.12: pkg_resources not supported + python-version: ["3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache Python dependencies + uses: actions/cache@v4 + id: pip-cache + with: + path: ~/.cache/pip + key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }} + restore-keys: | + pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.py') }} + + - name: Install python dependencies + if: steps.pip-cache.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + pip install -e .[dev] + + - name: Run test + run: pytest diff --git a/.github/workflows/tester.yml b/.github/workflows/tester.yml deleted file mode 100644 index 5791056..0000000 --- a/.github/workflows/tester.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: unit-tests -on: - pull_request: - merge_group: -jobs: - launch-unit-tests: - runs-on: ubuntu-latest - strategy: - matrix: - # Tracked via issue #77 - # 3.6: Not available on ubuntu-22.04 - # 3.7: Results in failures in `test_cli.py` - # 3.12: pkg_resources not supported - python-version: ["3.8", "3.9", "3.10", "3.11"] - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - run: python -m venv env - - run: source env/bin/activate - - run: env/bin/pip install -e . - - run: env/bin/pip install pytest - - run: env/bin/pytest diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 4a1d299..0000000 --- a/Pipfile +++ /dev/null @@ -1,15 +0,0 @@ - -# pipenv is useful for developing local package in -# editable mode. See https://pypi.org/project/pipenv/ - -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -dicom-anonymizer = {file = ".", editable = true} - -[dev-packages] -pytest = "*" -setuptools = "*" diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 6f2a918..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,43 +0,0 @@ -[project] -name = "dicom_anonymizer" -version = "1.0.12" -authors = [ - { name="Laurenn Lam", email="laurenn.lam@kitware.com" }, -] -description = "Program to anonymize dicom files with default and custom rules" -readme = "README.md" -requires-python = ">=3.6" -classifiers = [ - "Development Status :: 3 - Alpha", - "Intended Audience :: Science/Research", - "Topic :: Software Development :: Build Tools", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Programming Language :: Python" -] -keywords = ["dicom", "anonymizer" , "medical"] - -dependencies = [ - "pydicom", - "tqdm", -] - -[project.optional-dependencies] -dev = [ - "pytest", - "setuptools", # Needed to load pydicom's test files - "bs4", - "fire", - "requests" -] - -[project.scripts] -dicom-anonymizer = "dicomanonymizer.anonymizer:main" - -[project.urls] -"Homepage" = "https://github.com/KitwareMedical/dicom-anonymizer" -"Bug Tracker" = "https://github.com/KitwareMedical/dicom-anonymizer/issues" - -[tool.setuptools.packages] -find = {} # Scanning implicit namespaces is active by default - diff --git a/setup.py b/setup.py index 989276a..941e88e 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,23 @@ setup( name='dicom_anonymizer', # Required version='1.0.12', # Required + author='Laurenn Lam', + author_email='laurenn.lam@kitware.com', + description="Program to anonymize dicom files with default and custom rules", + url="https://github.com/KitwareMedical/dicom-anonymizer", + project_urls={ + "Bug Tracker": "https://github.com/KitwareMedical/dicom-anonymizer/issues", + }, + classifiers=[ + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "Topic :: Software Development :: Build Tools", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python" + ], + keywords=["dicom", "anonymizer", "medical"], + python_requires='>=3.6', packages=find_packages(), # Required @@ -25,6 +42,15 @@ # installed, so they must be valid existing projects. # # For an analysis of "install_requires" vs pip's requirements files see: - # https://packaging.python.org/en/latest/requirements.html + # https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/ install_requires=['pydicom', 'tqdm'], # Optional + + extras_require={ + 'dev': [ + "pytest", + "bs4", + "fire", + "requests" + ] + } )